This is Anti-pattern—thoughts on programming and whatnot by Brandon Weiss.

Require Sprockets When Not Using ActiveRecord

August 15th, 2011

If you use MongoMapper or Mongoid (or anything other than ActiveRecord) and recently upgraded to Rails 3.1.0.rc5, you may have noticed that the asset pipeline stopped working even thought it was working fine in 3.1.0.rc4. That’s because in rc5 the sprockets/railtie require is now explicit.

Just add require 'sprockets/railtie' to your config/application.rb file and you should be golden. Like this:

# config/application.rb
# require 'rails/all'
require 'action_controller/railtie'
require 'action_mailer/railtie'
require 'active_resource/railtie'
require 'sprockets/railtie'