P
P
Perzh2014-03-12 09:09:36
Ruby on Rails
Perzh, 2014-03-12 09:09:36

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

3 answer(s)
J
jFox, 2014-03-12
@Perzh

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 .

C
coolfusion, 2014-03-12
@coolfusion

@Perzh
Since this is production, we need to add this line.
config.assets.compile = true
in production.rb

T
The Whiz, 2014-03-12
@modernstyle

Does the gemfile say that the gem should work in all environments?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question