Upgrade from PR1=> RC1: Windows crash

Note: Posted this as a comment on http://weblog.rubyonrails.com/2007/11/9/rails-2-0-release-candidate-1/comments/17924#comment-17924 but realized it probably will be better to post here.

Upgrading from PR1 to RC1 gives me the following crash when starting webserver.

Any idea what is missing?

PS. (i have run the rake task twice to make sure it got actionwebservice as well: rake rails:freeze:gems TAG=rel_2-0-0_RC1 )

====stack trace below (same with mongrel and webrick)====

$ ruby script\server webrick => Booting WEBrick... ./script/../config/../ vendor/rails/railties/lib/initializer.rb:334:in `send': undefined method `session=' for ActionController::Base:Class (NoMethodError) from ./script/../config/../vendor/rails/railties/lib/initializer.rb: 334:in `initialize_framework_settings' from ./script/../config/../ vendor/rails/railties/lib/initializer.rb:333:in `each' from ./ script/../config/../vendor/rails/railties/lib/initializer.rb:333:in `initialize_framework_settings' from ./script/../config/../vendor/ rails/railties/lib/initializer.rb:330:in `each' from ./script/../ config/../vendor/rails/railties/lib/initializer.rb:330:in `initialize_framework_settings' from ./script/../config/../vendor/ rails/railties/lib/initializer.rb:100:in `process' from ./script/../ config/../vendor/rails/railties/lib/initializer.rb:47:in `send' from ./ script/../config/../vendor/rails/railties/lib/initializer.rb:47:in `run' ... 12 levels...

Here is the stack trace running Mongrel:

ruby script\server => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... Exiting C:/Documents and Settings/Administrator/My Documents/rails/berammelse/ vendor/rails/railties/lib/initializer.rb:334:in `send': undefined method `session=' for ActionController::Base:Class (NoMethodError)   from C:/Documents and Settings/Administrator/My Documents/rails/ berammelse/vendor/rails/railties/lib/initializer.rb:334:in `initialize_framework_settings'   from C:/Documents and Settings/Administrator/My Documents/rails/ berammelse/vendor/rails/railties/lib/initializer.rb:333:in `each'   from C:/Documents and Settings/Administrator/My Documents/rails/ berammelse/vendor/rails/railties/lib/initializer.rb:333:in `initialize_framework_settings'   from C:/Documents and Settings/Administrator/My Documents/rails/ berammelse/vendor/rails/railties/lib/initializer.rb:330:in `each'   from C:/Documents and Settings/Administrator/My Documents/rails/ berammelse/vendor/rails/railties/lib/initializer.rb:330:in `initialize_framework_settings'   from C:/Documents and Settings/Administrator/My Documents/rails/ berammelse/vendor/rails/railties/lib/initializer.rb:100:in `process'   from C:/Documents and Settings/Administrator/My Documents/rails/ berammelse/vendor/rails/railties/lib/initializer.rb:47:in `send'   from C:/Documents and Settings/Administrator/My Documents/rails/ berammelse/vendor/rails/railties/lib/initializer.rb:47:in `run'    ... 27 levels...

Most likely you don't have this defined in your environment.rb:

config.action_controller.session = {   :session_key => '_app_session',   :secret => 'random seed' }

Thanks Brennan. But config.action_controller.session was already in the environment.rb file. (and the project was created with "rails [project_name]" with Rails 2.0 PR1

Anyone else with a tip?

Brennan Dunn wrote:

What's your RAILS_GEM_VERSION in environment.rb? Are you using gems or vendor/rails?

# Specifies gem version of Rails to use when vendor/rails is not present RAILS_GEM_VERSION = '1.2.4' unless defined? RAILS_GEM_VERSION

I'm using vendor/rails

Koz wrote:

I'm using vendor/rails

And you have the preview release in there? The line numbers in your stack trace don't seem to line up with my checkout here?

Koz wrote:

And you have the preview release in there? The line numbers in your stack trace don't seem to line up with my checkout here?

After "rake rails:freeze:gems TAG=rel_2-0-0_RC1" there should be no doubt I had the preview release.

Let me know if you want me to try again sometimes or look for other particular things in order to track that bug down.

As a matter of fact I rolled back to the PR1 release to be able to continue working on the project, but I'll be happy to contribute, so just let me know what to do.

/Jesper

Koz wrote: > And you have the preview release in there? The line numbers in your > stack trace don't seem to line up with my checkout here?

After "rake rails:freeze:gems TAG=rel_2-0-0_RC1" there should be no doubt I had the preview release.

Let me know if you want me to try again sometimes or look for other particular things in order to track that bug down.

As a matter of fact I rolled back to the PR1 release to be able to continue working on the project, but I'll be happy to contribute, so just let me know what to do.

The line numbers in your stack traces correspond directly to the 1.2.5 / 1-2-stable initializer. So either you've made a mistake and checked the wrong thing out to vendor/rails, or it's picking up the gems irrespective of vendor/rails being there.

Can you try:

1) removing the RAILS_GEM_VERSION constant entirely. 2) manually checking out the latest edge and the release tags.

I tried to remove Rails 2.0PR1 entirely from /vendor/rails (rake rails:unfreeze) which gives exactly the same stack trace with the same line numbers. This confirms your theory that the numbers correspond to 1.2.5 (installed as gem on my machine).

rake rails:unfreeze ruby script\server

=> Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... Exiting c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.4/lib/initializer.rb:334:in `send': undefined method `session=' for ActionController::Base:Class (NoMethodError)   from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.4/lib/initializer.rb: 334:in `initialize_framework_settings'   from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.4/lib/initializer.rb: 333:in `each' ....

Koz wrote:

The line numbers in your stack traces correspond directly to the 1.2.5 / 1-2-stable initializer. So either you've made a mistake and checked the wrong thing out to vendor/rails, or it's picking up the gems irrespective of vendor/rails being there.

Can you try:

1) removing the RAILS_GEM_VERSION constant entirely. 2) manually checking out the latest edge and the release tags.

If i uncomment the RAILS_GEM_VERSION and update from trunk, it works. So everything is fine.

Thanks for your time and effort. I'm glad this isn't a bug in Rails 2.

/Jesper www.justaddwater.dk