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.rbtoconfig.assets.compile = true - I’ve checked that the compiled
image.pngis inpublic/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=productionshould fix it.If you don’t provide any
RAILS_ENV, Rails assumes it’sdevelopmentI 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.