Search code examples
ruby-on-rails-3herokuasset-pipelineprecompilecedar

Heroku precompilation of assets with no result


I'm using Heroku Cedar stack for my Rails application, and I want it to precompile the assets during slug compilation, because I don't want to bother with precompiled stuff in git.

Now it seams that everything should be ok, as during slug compilation the log says:

Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       /usr/local/bin/ruby /tmp/build_8bg62ph22vwj/vendor/bundle/ruby/1.9.1/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets

But when I try to access the site in heroku logs I get:

2011-11-30T08:23:52+00:00 app[web.1]: ActionView::Template::Error (blueprint/screen.css isn't precompiled):
2011-11-30T08:23:52+00:00 app[web.1]:     22:   <%= javascript_include_tag 'http://html5shiv.googlecode.com/svn/trunk/html5.js' %>
2011-11-30T08:23:52+00:00 app[web.1]:     23:   <![endif]-->
2011-11-30T08:23:52+00:00 app[web.1]:     24:   <%= javascript_include_tag  'application' %>
2011-11-30T08:23:52+00:00 app[web.1]:     25:   <%= stylesheet_link_tag     'blueprint/screen', :media => 'screen' %>
…

Do you have any idea where the problem can be?


Solution

  • Have you tried deploying the app locally? If so you will get the same result.

    When using the asset pipeline, it defaults to serving all CSS through application.css.

    Are you able to change your stylesheet tag to:

    <%= stylesheet_link_tag 'application' %>
    

    If that displays correctly in development, then it should also work in production.

    Alternatively, if you really need to include that file directly, then you will need to modify config/environments/production.rb to add:

    config.assets.precompile += %w( blueprint/screen.css )