Skip to content

Instantly share code, notes, and snippets.

@remi
Created September 25, 2012 17:38
Show Gist options
  • Save remi/3783343 to your computer and use it in GitHub Desktop.
Save remi/3783343 to your computer and use it in GitHub Desktop.
Clear Rails cache store and do it fast (without loading the whole Rails environment)
# bundle exec rake cache:clear
namespace :cache do
desc "Clear Rails.cache"
task :clear do
Object.const_set "RAILS_CACHE", ActiveSupport::Cache.lookup_store(Rails.configuration.cache_store)
Rails.cache.clear
puts "Successfully cleared Rails.cache!"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment