Heroku deploy / pre-compile custom assets

If you deploy your Rails Application to Heroku, you might obtain following error that is actually logged into the log and can be printed by heroku logs:

2012-12-01T19:14:19+00:00 app[web.1]: Completed 500 Internal Server Error in 3ms
2012-12-01T19:14:19+00:00 app[web.1]: 
2012-12-01T19:14:19+00:00 app[web.1]: ActionView::Template::Error (blueprint/blueprint/screen.css isn't precompiled):

This occurs because the auto-compile-mechanism of Rails doesn’t consider custom stylesheets. See http://guides.rubyonrails.org/asset_pipeline.html#in-production for further information.

Open config/production.rb and edit the variable config.assets.precompile as follows (This will work because the variable config.assets.precompile is an array and can be extended easily.):

  config.assets.precompile += Dir.glob( File.join("**/blueprint/*.css") )

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s