This project is archived and is in readonly mode.

#4106 ✓ resolved
DavidBackeus

Rails crashes unless config.action_controller.session is set

Reported by DavidBackeus | March 4th, 2010 @ 11:40 AM | in 3.0.2

Noted on edge rails at 0de3b9ec93e7221cfe24bd13d57616d8d8d03a57

Replicate (a fresh rails edge app will do):
rails error_app
cd error_app
(edit Gemfile to bundle edge rails from git) bundle install
script/rails console

Long stacktrace:
/Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/activesupport/lib/active_support/whiny_nil.rb:49:in method_missing': undefined methodsymbolize_keys' for nil:NilClass (NoMethodError)

from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb:74:in `initialize'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/stack.rb:74:in `new'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/stack.rb:74:in `build'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/stack.rb:126:in `block in build'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/stack.rb:126:in `each'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/stack.rb:126:in `inject'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/actionpack/lib/action_dispatch/middleware/stack.rb:126:in `build'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/application.rb:86:in `app'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:25:in `run'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:54:in `each'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/application.rb:67:in `initialize!'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/application.rb:41:in `method_missing'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands/console.rb:26:in `start'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands/console.rb:8:in `start'
from /Users/druiden/.rvm/gems/ruby-1.9.1-p378%rails3/bundler/gems/rails-16a5e918a06649ffac24fd5873b875daf66212ad-master/railties/lib/rails/commands.rb:34:in `<top (required)>'
from script/rails:9:in `require'
from script/rails:9:in `<main>'

This can be fixed by adding the following to config/application.rb:

config.action_controller.session = {:key => "_myapp_session", :secret => "198aa6a2ec7d631a6478139efbfa00f2"}

I guess if this is now required to be set manually it should be added automatically when generating a new app or have some more obvious error message.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

Pages