user2954587
user2954587

Reputation: 4861

Rails clear cache on heroku

How can I clear the cache on Heroku?

I've tried heroku run rails c + Rails.cache.clear and receive the following error

Errno::ENOENT: No such file or directory @ dir_initialize - /app/tmp/cache/

I also tried heroku run rake tmp:clear (from this post). The task runs but when I go back into the console and run Rails.cache, nothing has changed.

How can I clear the cache?

Upvotes: 3

Views: 3248

Answers (1)

K M Rakibul Islam
K M Rakibul Islam

Reputation: 34328

Did you try this? (This works with Celadon Cedar with the Heroku Toolbelt package at least)

heroku run --app YOUR_APP_NAME rails runner Rails.cache.clear

Update

If the above does not work, try running:

heroku run rake tmp:create
heroku run rake tmp:clear

Upvotes: 4

Related Questions