Skip to content

Instantly share code, notes, and snippets.

@rmm5t
Created December 7, 2011 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rmm5t/1443249 to your computer and use it in GitHub Desktop.
Save rmm5t/1443249 to your computer and use it in GitHub Desktop.
Precompile assets on Heroku with Mongoid
# The premise behind this was borrowed from https://gist.github.com/1239732
namespace :assets do
# Prepend the assets:prepare task to assets:precompile through
# assets:environment
task :environment => :prepare
task :prepare do
# Flag for custom initializers to know we're precompiling assets
ENV["RAILS_ASSETS_PRECOMPILE"] = "true"
# Prevent mongoid from loading
def Mongoid.load!(*args)
true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment