I'm attempting to deploy a web application on Amazon's EC2 servers, and I have the code up on the server. Everything looks like it's working, but when I go to the home page, I get a 500 error message and the production.log
file gives me the following error:
ActionView::Template::Error (image.png isn't precompiled)
I've tried running rake assets:precompile
,
I've changed the line in config/environments/production.rb
to config.assets.compile = true
image.png
is in public/assets/manifest.yml
but I still get the same error.
I'm running Rails 3.2.6 and Ruby 1.8.7.
Thanks for your help!
Running rake assets:precompile RAILS_ENV=production
should fix it.
If you don't provide any RAILS_ENV
, Rails assumes it's development
I believe that's because each env in the asset pipeline behaves differently. Therefore, as a general rule, in production, always run rake tasks with RAILS_ENV='production' and you should stay safe.