How to resolve Mixed Content errors

Develop applications with rails. I deployed it to the production environment (heroku), but it looks different ... I've solved it, but I'll keep a record of new discoveries!

Background of the problem

I deployed but the view is broken ↓ I haven't compiled the asset file! ↓

precompile RAILS_ENV=Run production


↓
 Deploy again. "This should be okay!"
↓
 It wasn't fixed ...

# Cause
 In conclusion, it wasn't a compilation issue, but the external page was an HTTP page. (The console says ``` This request has been blocked; the content must be served over HTTPS.```, but I haven't confirmed it.)
 It was a new discovery without knowing that it would cause an error when trying to load the http one while it was loaded by https!

# solution
 It was said that there is no problem if it is https, so I changed the path read by http to https, but it did not correspond ...
 This time I was thinking of reading the reset CSS from the outside and using it, so I solved it by creating a file as reset.css instead of reading it from the outside.

## Reference article
https://qiita.com/Kouch/items/5089fb36694c6e467a3a
https://www.transnet.ne.jp/2016/02/28/rails%e5%88%9d%e5%ad%a6%e8%80%85%e3%81%8c%e3%81%a4%e3%81%be%e3%81%9a%e3%81%8dcolnr%e3%80%8c%e3%82%a2%e3%82%bb%e3%83%83%e3%83%88%e3%83%91%e3%82%a4%e3%83%97%e3%83%a9%e3%82%a4%e3%83%b3/


Recommended Posts

How to resolve Mixed Content errors
[Technical memo] How to resolve errors
How to resolve Sprockets :: DoubleLinkError
How to resolve Git conflicts
How to resolve errors when doing git push heroku master
How to ignore Rubocop warnings (errors)
[Servlet / Ajax] How to resolve NoClassDefFoundError [Eclipse]
How to handle sign-in errors with devise
How to deploy
How to resolve errors that occur in the "Ruby on Rails" integration test
How to develop OpenSPIFe
How to call AmazonSQSAsync
How to use Map
How to write Rails
How to use rbenv
How to use letter_opener_web
How to use fields_for
How to use java.util.logging
How to use map
How to use collection_select
How to adapt Bootstrap
How to use Twitter4J
How to use active_hash! !!
How to install Docker
How to use MapStruct
How to use hidden_field_tag
How to use TreeSet
How to uninstall Rails
How to install docker-machine
[How to use label]
How to make shaded-jar
How to use identity
How to use hashes
How to write Mockito
How to create docker-compose
How to use JUnit 5
How to install MySQL
How to write migrationfile
How to build android-midi-lib
How to use Dozer.mapper
How to use Gradle
How to use org.immutables
How to use java.util.stream.Collector
How to use VisualVM
How to resolve SSL_connect error in PayPal Ruby SDK
How to use Map
How to install ngrok
How to type backslash \
How to concatenate strings
An unsupported Java version How to get rid of errors
How to resolve Missing Template error when implementing comment function
How to create an application
[Java] How to use Map
[rails] How to post images
[AWS] How to check logs
How to use Chain API
How to lower java version
[Java] How to use Map
How to use Priority Queuing
How to uninstall Java 8 (Mac)
How to write good code