Home
subscribe

L'etat, c'est moi

Mere Complexities sells the consulting and development services of me, Paul Wilson.

Conferences

Organising Scotland on Rails
Speaker, RailsConf Europe '08

Archive

Edgy Rails Circular Silliness

I’ve been using Rails Edge on a project for no particular reason. Today I did an svn update and things stopped working.

A secret is required to generate an integrity hash for cookie session data. Use config.action_controller.session = { :secret => “some secret phrase” } in config/environment.rb

No problem – I followed those instructions and added the option to config/environment.rb. Then I got another problem.

ArgumentError (`name’ required):
/vendor/rails/actionpack/lib/action_controller/cgi_ext/cookie_performance_fix.rb:44:in `initialize’
/vendor/rails/actionpack/lib/action_controller/session/cookie_store.rb:129:in `write_cookie’

All I could find was this post. The resolution was to update everything, create a new project, and copy code in. I couldn’t be bothered with this, so I unfroze and went to gem rails (1.2.2). Now neither Mongrel or Webrick will start.

/opt/local/lib/ruby/gems/1.8/gems/rails-1.2.2/lib/initializer.rb:328:in `send’: undefined method `session=’ for ActionController::Base:Class (NoMethodError)

Aaargh! I googled for the exception and found nothing. Eventually I check out initializer.rb and realise what’s happening. From config/environment.rb I remove

config.action_controller.session = { :secret => “some secret phrase” }

Problem gone.

Lessons? When I give up on one way of fixing a problem, completely back out of that fix before trying another.

All