Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

uninitialized constant ActionDispatch::Session::RedisSessionStore (NameError) #127

Closed
colinwong opened this Issue Apr 12, 2012 · 9 comments

Comments

Projects
None yet
4 participants

Hi.

I'm running Rails 3.1.3 on Ruby 1.9.2p0. My code worked great when I had this in my gemfile:

gem 'redis-store', '~> 1.0.0.rc1'

But I then upgraded to the latest 1.1.0 version and uninstall the previous versions. I changed my gemfile this:

gem 'redis-store'

Now I'm getting this error.

/usr/local/lib/ruby/gems/1.9.1/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in const_missing_from_s3_library': uninitialized constant ActionDispatch::Session::RedisSessionStore (NameError) from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application/configuration.rb:131:inconst_get'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application/configuration.rb:131:in session_store' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:172:inblock in default_middleware_stack'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:146:in tap' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:146:indefault_middleware_stack'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/engine.rb:446:in app' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application/finisher.rb:37:inblock in module:Finisher'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:in instance_exec' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:30:inrun'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:55:in block in run_initializers' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:ineach'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/initializable.rb:54:in run_initializers' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application.rb:96:ininitialize!'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in method_missing' from /Users/colin/Sites/ebible/config/environment.rb:5:in<top (required)>'
from /Users/colin/Sites/ebible/config.ru:4:in block in <main>' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/builder.rb:51:ininstance_eval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/builder.rb:51:in initialize' from /Users/colin/Sites/ebible/config.ru:1:innew'
from /Users/colin/Sites/ebible/config.ru:1:in <main>' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/builder.rb:40:ineval'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/builder.rb:40:in parse_file' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/server.rb:200:inapp'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:46:in app' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/server.rb:301:inwrapped_app'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.3.5/lib/rack/server.rb:252:in start' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands/server.rb:70:instart'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:54:in block in <top (required)>' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:intap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/commands.rb:49:in <top (required)>' from script/rails:6:inrequire'

from script/rails:6:in `'

Any ideas?

@mhoran mhoran was assigned Apr 12, 2012

Owner

jodosha commented Apr 12, 2012

OK. Here's what I tried.

Upgraded Rails from 3.1 to 3.2.
Installed redis-rails.

Same issue. Here's the output.

/usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application/configuration.rb:140:in const_get': uninitialized constant ActionDispatch::Session::RedisSessionStore (NameError) from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application/configuration.rb:140:insession_store'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:268:in block in default_middleware_stack' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:232:intap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:232:in default_middleware_stack' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/engine.rb:469:inapp'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application/finisher.rb:31:in block in <module:Finisher>' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:ininstance_exec'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:30:in run' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:55:inblock in run_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:in each' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/initializable.rb:54:inrun_initializers'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/application.rb:136:in initialize!' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/railtie/configurable.rb:30:inmethod_missing'
from /Users/colin/Sites/ebible/config/environment.rb:5:in <top (required)>' from /Users/colin/Sites/ebible/config.ru:4:inblock in

'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in instance_eval' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:ininitialize'
from /Users/colin/Sites/ebible/config.ru:1:in new' from /Users/colin/Sites/ebible/config.ru:1:in'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:in eval' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:40:inparse_file'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:200:in app' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands/server.rb:46:inapp'
from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in wrapped_app' from /usr/local/lib/ruby/gems/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:instart'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands/server.rb:70:in start' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:55:inblock in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:50:in tap' from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/commands.rb:50:in<top (required)>'
from script/rails:6:in require' from script/rails:6:in'

My session_store.rb file has this:

MyApp::Application.config.session_store :redis_session_store,
:servers => { :host => REDIS_HOST, :port => REDIS_PORT },
:key_prefix => "MyApp:rails:session",
:expire_in => 30.minutes

Contributor

mhoran commented Apr 12, 2012

In 1.1, you need to change redis_session_store to redis_store.

Ah! That did the trick! Thanks!! The Wiki instructions need to be updated then.

@colinwong colinwong closed this Apr 12, 2012

Contributor

mhoran commented Apr 12, 2012

Updated, thanks.

It would be cool if you can update the info here. http://jodosha.github.com/redis-store/rack-session.html This comes up first in the google search :)

Thanks
Shishir Kakaraddi

Contributor

mhoran commented Nov 15, 2012

Unfortunately I don't have access to that site. @jodosha, could you update that? Perhaps we should just point it at the wiki, as most of the documentation on that site is out of date at this point.

Owner

jodosha commented Nov 18, 2012

Updated. @mhoran You already have access, it's the gh-pages branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment