Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

rails won't go

1 view
Skip to first unread message

Luca Pireddu

unread,
Dec 1, 2004, 12:59:06 AM12/1/04
to
I'm trying out the rails tutorial (http://www.rubyonrails.org/show/Tutorial).
I've reached step six where I get to access my new page but things don't work.
I'm hoping someone can help me figure out what the problem is.

I've tried accessing the page via the WEBrick servlet. I started it with
ruby dispatch.servlet -a
and then pointed my browser to http://localhost:3000/friends/display

I'm greeted with
Not Found

`/friends/display' not found.
WEBrick/1.3.1 (Ruby/1.8.2/2004-11-23) at localhost:3000

On the display WEBrick shows me the following error:


#<WEBrick::HTTPStatus::NotFound: `/friends/display' not found.>
/usr/lib/ruby/1.8/cgi/session.rb:264:in `initialize': undefined method `create_new_id' for CGI::Session:Class (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/cgi_process.rb:70:in `new'
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/cgi_process.rb:70:in `session'
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:558:in`assign_shortcuts'
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:250:in`process'
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:242:in`process'
from /usr/lib/ruby/gems/1.8/gems/rails-0.8.5/lib/dispatcher.rb:35:in `dispatch'
from /home/luca/public_html/PathRails/public/dispatch.rb:10
from /home/luca/public_html/PathRails/public/dispatch.rb:1:in `load'
from /home/luca/public_html/PathRails/public/dispatch.rb:1
from -:7
#<NoMethodError: undefined method `each' for nil:NilClass>
["/usr/lib/ruby/1.8/webrick/httputils.rb:129:in `parse_header'",
"/usr/lib/ruby/gems/1.8/gems/rails-0.8.5/lib/webrick_server.rb:129:in `handle_dispatch'",
"/usr/lib/ruby/gems/1.8/gems/rails-0.8.5/lib/webrick_server.rb:75:in `handle_mapped'",
"/usr/lib/ruby/gems/1.8/gems/rails-0.8.5/lib/webrick_server.rb:30:in `do_GET'",
"/usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'",
"/usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service'",
"/usr/lib/ruby/1.8/webrick/httpserver.rb:97:in `service'",
"/usr/lib/ruby/1.8/webrick/httpserver.rb:58:in `run'",
"/usr/lib/ruby/1.8/webrick/server.rb:150:in `start_thread'",
"/usr/lib/ruby/1.8/webrick/server.rb:144:in `start'",
"/usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'",
"/usr/lib/ruby/1.8/webrick/server.rb:94:in `start'",
"/usr/lib/ruby/1.8/webrick/server.rb:89:in `each'",
"/usr/lib/ruby/1.8/webrick/server.rb:89:in `start'",
"/usr/lib/ruby/1.8/webrick/server.rb:79:in `start'",
"/usr/lib/ruby/1.8/webrick/server.rb:79:in `start'",
"/usr/lib/ruby/gems/1.8/gems/rails-0.8.5/lib/webrick_server.rb:17:in `dispatch'",
"dispatch.servlet:45"]

------------------------- end WEBrick error --------------------------

I've also tried with Apache, but I end up with a similar error in the log:

/usr/lib/ruby/1.8/cgi/session.rb:264:in `initialize': undefined method
`create_new_id' for CGI::Session:Class (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/cgi_process.rb:70:in `new'
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/cgi_process.rb:70:in `session'
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:558:in`assign_shortcuts'
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:250:in`process'
from /usr/lib/ruby/gems/1.8/gems/actionpack-0.9.5/lib/action_controller/base.rb:242:in`process'
from /usr/lib/ruby/gems/1.8/gems/rails-0.8.5/lib/dispatcher.rb:35:in `dispatch'
from /home/luca/public_html/PathRails/public/dispatch.cgi:7
[Tue Nov 30 22:46:05 2004] [error] [client 68.148.246.54] Premature end of
script headers: /home/luca/public_html/PathRails/public/dispatch.cgi


-------------------------- end error msg ------------------

On the other hand, at the browser I'm greeted with the rails 500.html message:

Application error (Apache)

Change this error message for exceptions thrown outside of an action (like in
Dispatcher setups or broken Ruby code) in public/500.html


Here's my setup:
[fidele apache]# gem list --local

*** LOCAL GEMS ***

actionmailer (0.4.0)
Service layer for easy email delivery and testing.

actionpack (0.9.5)
Web-flow and rendering framework putting the VC in MVC.

activerecord (1.1.0)
Implements the ActiveRecord pattern for ORM.

rails (0.8.5)
Web-application framework with template engine, control-flow layer,
and ORM.

rake (0.4.11, 0.4.8)
Ruby based make-like utility.

rubygems-update (0.8.1)
RubyGems Update GEM

sources (0.0.1)
This package provides download sources for remote gem installation

[fidele apache]# ruby --version
ruby 1.8.2 (2004-11-23) [i386-linux]

[fidele apache]# apache -version
Server version: Apache/1.3.33 (Debian GNU/Linux)
Server built: Nov 18 2004 11:09:51

If there's any other info I should provide let me know. TIA

Luca

David Heinemeier Hansson

unread,
Dec 1, 2004, 5:52:13 AM12/1/04
to
> /usr/lib/ruby/1.8/cgi/session.rb:264:in `initialize': undefined method
> `create_new_id' for CGI::Session:Class (NoMethodError)

Sounds like 1.8.2 change the API for CGI::Session:Class. Rails is
currently only verified to run on 1.8.1. But I would like to make it
ready for 1.8.2. Anyone know what changed?
--
David Heinemeier Hansson,
http://www.basecamphq.com/ -- Web-based Project Management
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://macromates.com/ -- TextMate: Code and markup editor (OS X)
http://www.loudthinking.com/ -- Broadcasting Brain

Mauricio Fernández

unread,
Dec 1, 2004, 6:04:17 AM12/1/04
to
On Wed, Dec 01, 2004 at 07:52:13PM +0900, David Heinemeier Hansson wrote:
> >/usr/lib/ruby/1.8/cgi/session.rb:264:in `initialize': undefined method
> >`create_new_id' for CGI::Session:Class (NoMethodError)
>
> Sounds like 1.8.2 change the API for CGI::Session:Class. Rails is
> currently only verified to run on 1.8.1. But I would like to make it
> ready for 1.8.2. Anyone know what changed?

Session.create_new_id has become Session#create_new_id
(http://tinyurl.com/5j7nx). This was reported on Nov 27 [ruby-core:3832],
and fixed on Nov 29 (http://tinyurl.com/3pvrw).

--
Hassle-free packages for Ruby?
RPA is available from http://www.rubyarchive.org/


David Heinemeier Hansson

unread,
Dec 1, 2004, 10:27:06 AM12/1/04
to
> Session.create_new_id has become Session#create_new_id
> (http://tinyurl.com/5j7nx). This was reported on Nov 27
> [ruby-core:3832],
> and fixed on Nov 29 (http://tinyurl.com/3pvrw).

Ahh, okay. So if people see this error they'll have to apply
http://tinyurl.com/3pvrw or update to the CVS version. Gotcha. Thanks!

Luca Pireddu

unread,
Dec 1, 2004, 11:39:46 AM12/1/04
to
David Heinemeier Hansson wrote:

Thank you very much. It's working now :-)

0 new messages