Ruby Forum Rails-core (closed, excessive spam) > Upgrade from PR1=> RC1: Windows crash

Posted by Jesper Rønn-Jensen (Guest)
on 11.11.2007 19:25
(Received via mailing list)
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...
Posted by Jesper Rønn-Jensen (Guest)
on 11.11.2007 19:28
(Received via mailing list)
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...
Posted by Brennan Dunn (Guest)
on 11.11.2007 19:42
(Received via mailing list)
Most likely you don't have this defined in your environment.rb:

config.action_controller.session = {
  :session_key => '_app_session',
  :secret      => 'random seed'
}
Posted by Jesper Rønn-Jensen (Guest)
on 11.11.2007 21:10
(Received via mailing list)
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?
Posted by Michael Koziarski (Guest)
on 11.11.2007 22:09
(Received via mailing list)
What's your RAILS_GEM_VERSION in environment.rb?  Are you using gems
or vendor/rails?

On Nov 12, 2007 9:09 AM, Jesper Rønn-Jensen <jesperrr@gmail.com> wrote:
> >
> > config.action_controller.session = {
> >         :session_key => '_app_session',
> >         :secret      => 'random seed'
> >
> > }
>
>
>
> >
>



--
Cheers

Koz
Posted by Jesper Rønn-Jensen (Guest)
on 12.11.2007 11:13
(Received via mailing list)
# 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
Posted by Michael Koziarski (Guest)
on 13.11.2007 08:40
(Received via mailing list)
> 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?



--
Cheers

Koz
Posted by Jesper Rønn-Jensen (Guest)
on 13.11.2007 21:24
(Received via mailing list)
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
Posted by Michael Koziarski (Guest)
on 14.11.2007 06:34
(Received via mailing list)
> 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.



--
Cheers

Koz
Posted by Jesper Rønn-Jensen (Guest)
on 20.11.2007 10:58
(Received via mailing list)
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