I have added these two lines to application.rb:
config.assets.initialize_on_precompile = false
config.assets.compile = true
However I still get errors when I push to Heroku:
2012-02-05T09:48:34+00:00 app[web.1]: Completed 500 Internal Server Error in 3ms
2012-02-05T09:48:34+00:00 app[web.1]:
2012-02-05T09:48:34+00:00 app[web.1]: ActionView::Template::Error (bootstrap.css isn't precompiled):
Any suggestions?
By the looks of it you have a bootstrap.css
file that is not included properly in your manifest file within app/assets/stylesheets
and that you're probably also calling directly from a stylesheet_tag
.
There are a couple of approaches to this:
config.assets.precompile += %w( bootstrap.css )
…for example.
/* *= require bootstrap */
/* rest of file omitted */
You might need to require more files than that depending on what your css setup is.
Try to use rake assets:precompile
before committing your code and pushing it to heroku.
read this, it's a tutorial on how to get rails 3.2.1 (and ruby 1.9.3) running on heroku. You can obviously skip the bits you don't need but it should explain why these problems are happening and how to fix them.
Also, read this article by david rice, author of the useful asset_sync gem. It will help you sort this out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With