I'm reading the "Rails Tutorial: Learn Rails 3.2 By Example" book but I have a slight problem at the end of chapter 4.
In the book you download the Blueprint css framework, add it to /vendor/assets/stylesheets and then reference it in layouts/application.html.erb using:
<%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
<%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>
<!--[if lt IE 8]><%= stylesheet_link_tag 'blueprint/ie' %><![endif]-->
This works fine on my local machine, but when I deploy it to heroku (cedar) using
$ bundle exec rake assets:precompile
$ git push heroku
It gives an error when I view the site:
app[web.1]: Completed 500 Internal Server Error in 71ms
app[web.1]: ActionView::Template::Error (blueprint/screen.css isn't precompiled):
app[web.1]: 4: <%= stylesheet_link_tag 'blueprint/screen', media: 'screen' %>
app[web.1]: 5: <%= stylesheet_link_tag 'blueprint/print', media: 'print' %>
At the moment the only way I've been able to get it working is to manually tell rails about the blueprint stylesheets by putting this in production.rb
config.assets.precompile += %w( blueprint/screen.css blueprint/print.css blueprint/ie.css )
Am I doing something wrong? Is there a way to get rake assets:precompile
to automatically minify/compress all the files in /vendor/assets/ (if there is, is there a downside to doing this)?
Thanks in advance for any advice.