How to build task 'assets:precompile'

tybro0103 picture tybro0103 · Aug 26, 2011 · Viewed 17.4k times · Source

I'm getting that error on my production server, and can't figure out why. It happens when running this command:

bundle exec rake assets:precompile RAILS_ENV=production

I'm using Rails 3.1.0.rc6

Answer

Koraktor picture Koraktor · Aug 31, 2011

This is most likely due your config/application.rb not requiring rails/all (the default), but some custom requires.

To resolve this, add the following to config/application.rb:

require 'sprockets/railtie'