ruby-on-railsimageasset-pipelineprecompiled

Rails - image.png Isn't Precompiled


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)

but I still get the same error.

I'm running Rails 3.2.6 and Ruby 1.8.7.

Thanks for your help!


Solution

  • 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.