Patch Review Request: #1750 session_store initializer causes rake:gems tasks to break

I added a patch for this ticket, but I really have no idea how to unit test it.

If I have a gem configured in environment.rb but do not have it installed, rake:gems will not run successfully. Here is the output I see:

rake aborted!
A session_key is required to write a cookie containing the session data. Use config.action_controller.session = { :session_key => "_myapp_session", :secret => "some secret phrase" } in config/environment.rb

My patch allows initializers to be run within gems rake tasks, which fixes the issue for me.

  • Adam