rails won't go

L

Luca Pireddu

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
 
D

David Heinemeier Hansson

/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
 
D

David Heinemeier Hansson

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!
--
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
 
L

Luca Pireddu

David said:
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!
--
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

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top