LoginSignup
126
105

More than 5 years have passed since last update.

【Rails】cacheを消したい時のワンライナー

Last updated at Posted at 2015-01-13

更新)redisでキャッシュを利用している場合も動作確認済み

ワンライナーで削除するコマンドはこちら

bundle exec rails r 'Rails.cache.clear'

Springを使って実行する場合はこちら

bin/rails r 'Rails.cache.clear'

memcachedとRedisでそれぞれキャッシュを格納している場合にも対応している

確認しに使用したライブラリは
* memcachedの場合はdalli
* Redisの場合はredis-rails

以下のコマンドだとmemcachedのデータが消えなかった

rake tmp:cache:clear
126
105
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
126
105