I applied cache to my heroku rails app and it works well. But everytime I deploy to heroku, I also want to clear cache automatically.
so I googled and I found this.
task :after_deploy, :env, :branch do |t, args|
puts "Deployment Complete"
puts "Cleaning all cache...."
FileUtils.cd Rails.root do
sh %{heroku run console}
sh %{Rails.cache.clear}
end
end
but when I raked this script, it just show the heroku console command line but the Rails.cache.clear command does not typed. (I guess that is because heroku console is interactive)
and
system "heroku console Rails.cache.clear"
doesn't work for cedar apps.
How can I solve this problem?
Thanks.