0
나는 다음과 같이 설정/application.rb을 변경하여 레일 3 세션 저장소를 전환하기 위해 노력하고있어 :세션 옵션을 가져 오지 못 했습니까?
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의 서버가 실행 중입니다.
=> Booting WEBrick
=> Rails 3.0.0.beta3 application starting in development on 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)
세션 옵션이 올바르게 전달되지 않은 것 같다 rails s
를 실행할 때, 나는이 메시지를 받았습니다. 하지만 난 아니야 내가 Rails를 처음 사용했기 때문에 잘못된 것이 확실하다.
도움이 될 것입니다.
감사