Answer the question
In order to leave comments, you need to log in
Why doesn't bootstrap work in production?
Learning RoR by making a simple blog. I decided to add a primitive design using the bootstrap-sass v 2.3.2.0 gem. On localhost everything works fine, but on heroku it doesn't work. It can be seen that the HTML skeleton has changed, but the bootstrap styles are not included (when you inspect an element with a 'well' class, for example, the browser cannot find such a class). The gem is installed on the server. What could be the problem?
Answer the question
In order to leave comments, you need to log in
rake assets:precompile
- required for images, js and css files to be accessible from the public folder (Heroku requirement).
In the case of Bootstrap, it is better to abandon the gem and directly connect from the CDN in order to avoid a lot of problems and increase page loading speed.
Plus, there are also links to many ready-made design styles .
@Perzh
Since this is production, we need to add this line.
config.assets.compile = true
in production.rb
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question