# \[Rails 3\] Failed to get session options

**URL:** <https://www.ruby-forum.com/t/rails-3-failed-to-get-session-options/187752>\
**Category:** Rails\
**Created:** [April 28, 2010, 8:32pm UTC](https://www.ruby-forum.com/t/rails-3-failed-to-get-session-options/187752 "2010-04-28T20:32:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![S\_obj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/edb3f5/32.png) [@S\_obj](https://www.ruby-forum.com/u/S_obj)\
**Post date:** [April 28, 2010, 8:32pm UTC](https://www.ruby-forum.com/t/rails-3-failed-to-get-session-options/187752/1 "2010-04-28T20:32:11Z")

</div>

Hi everybody,

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

config/application.rb  
#-----------------------------------  
memcache\_options = {  
:compression =\> true,  
:debug =\> false,  
:namespace =\> “xx-cache”,  
:readonly =\> false,  
:urlencode =\> false  
}  
CACHE = MemCache.new(memcache\_options)  
CACHE.servers = [‘127.0.0.1:17898’]  
#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  
message:

=\> Booting WEBrick  
=\> Rails 3.0.0.beta3 application starting in development on  
[http://0.0.0.0:3000](http://0.0.0.0:3000)  
=\> Call with -d to detach  
=\> Ctrl-C to shutdown server  
Exiting  
/usr/lib/ruby/gems/1.9.1/gems/actionpack-3.0.0.beta3/lib/  
action\_dispatch/middleware/session/mem\_cache\_store.rb:19:in  
`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.  
Thanks
