Skip to content

Instantly share code, notes, and snippets.

@nthj
Created October 25, 2012 20:30
Show Gist options
  • Save nthj/3955195 to your computer and use it in GitHub Desktop.
Save nthj/3955195 to your computer and use it in GitHub Desktop.
Nuke your cache on deployment in Rails 3
# Throw this into config/initializers/cache.rb
if ARGV.any? { |a| %w(s server thin).include?(a) }
puts "=> Initializing environment, clearing cache"
Rails.cache.clear
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment