Rails清除Heroku上的缓存 [英] Rails clear cache on heroku

查看:87
本文介绍了Rails清除Heroku上的缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何清除Heroku上的缓存?

How can I clear the cache on Heroku?

我尝试了heroku run rails c + Rails.cache.clear并收到以下错误

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/

我还尝试了heroku run rake tmp:clear(来自 帖子).该任务已运行,但是当我返回控制台并运行Rails.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.

如何清除缓存?

推荐答案

您尝试过吗? (至少在Heroku Toolbelt package上与Celadon Cedar一起使用)

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

这篇关于Rails清除Heroku上的缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆