[Rails 3] Failed to get session options

Hi everybody,

I’m trying to switch the session store in Rails 3 by changing the
config/application.rb as following:

memcache_options = {
:compression => true,
:debug => false,
:namespace => “xx-cache”,
:readonly => false,
:urlencode => false
CACHE = MemCache.new(memcache_options)
CACHE.servers = [‘’]
#check if CACHE is connected
#puts CACHE
config.action_dispatch.session = {
:session_key => ‘_xx_session’,
:secret => ‘xx’,
:cache => CACHE,
:expires => 900
config.action_dispatch.session_store = :mem_cache_store

Memcache server is running. However, when run “rails s”, i got this

=> Booting WEBrick
=> Rails 3.0.0.beta3 application starting in development on
=> Call with -d to detach
=> Ctrl-C to shutdown server
`initialize’: #ActionDispatch::Session::MemCacheStore:0xa302950
unable to find server during initialization. (RuntimeError)

It seems the session options was not passed correctly. But i’m not
sure what’s wrong here cause I’m new to Rails.

Any help will be appreciated.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs