Heroku で Rails 3.2.11 および Dalli 2.6.4 で memcached を使用すると問題が発生します。Rails.cache.clear
Memcached は開発ではうまく機能しますが、Heroku のステージング環境にプッシュすると、キャッシュされたページにアクセスしたり、コンソールに書き込んだりすると、次のエラーが発生します。
NoMethodError: undefined method `split' for nil:NilClass
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/dalli/server.rb:35:in `initialize'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/dalli/client.rb:334:in `new'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/dalli/client.rb:334:in `block in ring'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/dalli/client.rb:326:in `map'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/dalli/client.rb:326:in `ring'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/dalli/client.rb:238:in `flush'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/active_support/cache/dalli_store.rb:196:in `block in clear'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/active_support/cache/dalli_store.rb:291:in `block in instrument'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/notifications.rb:125:in `instrument'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/active_support/cache/dalli_store.rb:291:in `instrument'
from /app/vendor/bundle/ruby/1.9.1/gems/dalli-2.6.4/lib/active_support/cache/dalli_store.rb:195:in `clear'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.11/lib/active_support/cache/strategy/local_cache.rb:88:in `clear'
from (irb):1
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
の関連部分staging.rb
:
config.cache_store = :dalli_store, nil,
{:namespace => 'STAGING', :expires_in => 1.day.to_i, :compress => true }
config.action_dispatch.rack_cache = nil
この問題の原因は何ですか?