简体   繁体   中英

Heroku and HighCharts Rails Gem -

I created a rails app using the HighCharts gem and an external API to seed the db. Everything works perfectly on my local server but when I deployed to Heroku (using postgreSQL) and running all the heroku run rake db:migrate, db:seed commands, my chart does not load.

I get the following error in my console:

Mixed Content: The page at 'https://myappname.herokuapp.com/' was loaded over HTTPS, but requested an insecure stylesheet 'http://fonts.googleapis.com/css?family=Signika:400,700'. This request has been blocked; the content must be served over HTTPS.

I am using a theme which I require in my application.js file that uses googlefonts via HTTP (NOT HTTPS) and I think I need to change this to //fonts.google... but I don't know how since I'm using the gem.

When I tell my browser (Chrome) to display the insecure scripts, the chart still does not appear and the console spits out an empty array which tells me my data is not in Heroku.

Please let me know what other info I can provide. As you can see I think I have 2 issues.

Thank you!

With the help of the HighCharts Rails gem folks, I was able to manually download the source code and change the pertinent parts to be protocol independent. All it required was copying the theme.js code into app/assets/javascripts , make the changes, and load that file instead of //= require highcharts/themes/sand-signika in my application.js.

Am still having an issue with data not migrating from my local db to Heroku...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM