Reputation: 875
I'm using the bootstrap-sass gem with my rails (3.2.5) app, and things are working great in my local dev environment. But when I deploy to prod on Heroku the bootstrap CSS isn't included in the compiled assets.
I added bootstrap-sass and sass-rails to my Gemfile:
gem 'bootstrap-sass', '2.0.3.1'
group :assets do
gem 'sass-rails', '3.2.4'
end
And I added an import for Bootstrap to a custom.css file in my assets dir:
@import "bootstrap";
Basic stuff. Any idea why this isn't working in Prod?
Upvotes: 0
Views: 4338
Reputation: 428
I was running into exact same problem. These are the steps I followed to resolve the issue:
Add " *= require bootstrap" right above " *= require_tree ." in application.css.
Then I did "bundle install --without production"
Then I ran "rake assets:precompile"
Then I did git add .
Then I committed the changes git commit -m "blah..."
Then push changes to production "git push heroku master"
Upvotes: 4
Reputation: 10744
You must add a bootstrap_and_overrides.css.scss
file in your app/assets/stylesheets
with the next:
// Set the correct sprite paths
$iconSpritePath: asset-url('glyphicons-halflings.png', image);
$iconWhiteSpritePath: asset-url("glyphicons-halflings-white.png", image);
@import "bootstrap";
@import "bootstrap-responsive";
Also, you must add in your application.js
:
//= require bootstrap
Regards!
Upvotes: 2