Can't get rails to work

F

Fredrik Jagenheim

Just trying to do the simple examples seen in both the tutorial and video.

But when I try to access my newly created controller
(./scripts/new_controller Foo) in the browser by accessing
'http://rails/foo/' I get this:

/home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:32:in
`rescue_errors': undefined method `info' for nil:NilClass
(NoMethodError)
from /home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:14:in
`initialize'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5:in `new'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5
[Tue Jul 27 02:00:06 2004] [error] [client 127.0.0.1] Premature end of
script headers: /home/fredde/projects/ruby/rails/public/dispatch.cgi


For some reason 'ActionController::Base.logger' is nil. I don't see
anywhere it is initialized either so I'm not sure what I'm missing.

Have I forgot something?

//F
 
M

Martin Stannard

Just trying to do the simple examples seen in both the tutorial and video.
But when I try to access my newly created controller
(./scripts/new_controller Foo) in the browser by accessing
'http://rails/foo/' I get this:

/home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:32:in
`rescue_errors': undefined method `info' for nil:NilClass
(NoMethodError)
from
/home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:14:in
`initialize'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5:in
`new'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5
[Tue Jul 27 02:00:06 2004] [error] [client 127.0.0.1] Premature end of
script headers: /home/fredde/projects/ruby/rails/public/dispatch.cgi


For some reason 'ActionController::Base.logger' is nil. I don't see
anywhere it is initialized either so I'm not sure what I'm missing.

Have I forgot something?

//F

Did you extract with the correct flags as per
http://www.rubyonrails.org/show/GettingStartedWithRails ?

Check the permissions on the log files in rails/log and make sure they are
writeable.

regards,

Martin
 
D

David Heinemeier Hansson

For some reason 'ActionController::Base.logger' is nil. I don't see
anywhere it is initialized either so I'm not sure what I'm missing.

Have I forgot something?

Make sure you follow all the steps on
http://www.rubyonrails.org/show/GettingStartedWithRails. Sounds like
perhaps you forgot step 2, which causes the permissions to be bad. If
you're having more problems, I'm sure the friendly Railers at
#rubyonrails on FreeNET can help you :)
--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services
 
J

Jim Weirich

Fredrik said:
Just trying to do the simple examples seen in both the tutorial and video.

But when I try to access my newly created controller
(./scripts/new_controller Foo) in the browser by accessing
'http://rails/foo/' I get this:

/home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:32:in
`rescue_errors': undefined method `info' for nil:NilClass
(NoMethodError)
from /home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:14:in
`initialize'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5:in `new'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5
[Tue Jul 27 02:00:06 2004] [error] [client 127.0.0.1] Premature end of
script headers: /home/fredde/projects/ruby/rails/public/dispatch.cgi

For some reason 'ActionController::Base.logger' is nil. I don't see
anywhere it is initialized either so I'm not sure what I'm missing.

Check the permissions on your log directory and log file and make sure
that the www-data user (or whatever apache runs as) can write to those
directories.

This stymied me for a while as well.
 
M

Martin Stannard

Just trying to do the simple examples seen in both the tutorial and video.
But when I try to access my newly created controller
(./scripts/new_controller Foo) in the browser by accessing
'http://rails/foo/' I get this:

/home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:32:in
`rescue_errors': undefined method `info' for nil:NilClass
(NoMethodError)
from
/home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:14:in
`initialize'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5:in
`new'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5
[Tue Jul 27 02:00:06 2004] [error] [client 127.0.0.1] Premature end of
script headers: /home/fredde/projects/ruby/rails/public/dispatch.cgi


For some reason 'ActionController::Base.logger' is nil. I don't see
anywhere it is initialized either so I'm not sure what I'm missing.

Have I forgot something?

//F

Check the permissions on your log files and make sure they are writeable
by all. See http://www.rubyonrails.org/show/GettingStartedWithRails

regards,

Martin
 
D

Daniel Hobe

You might need to fix the permissions on the directory where Apache will
write the log files for this virtual host.

Fredrik said:
Just trying to do the simple examples seen in both the tutorial and video.

But when I try to access my newly created controller
(./scripts/new_controller Foo) in the browser by accessing
'http://rails/foo/' I get this:

/home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:32:in
`rescue_errors': undefined method `info' for nil:NilClass
(NoMethodError)
from /home/fredde/projects/ruby/rails/public/../vendor/railties/../../vendor/railties/dispatcher.rb:14:in
`initialize'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5:in `new'
from /home/fredde/projects/ruby/rails/public/dispatch.cgi:5
[Tue Jul 27 02:00:06 2004] [error] [client 127.0.0.1] Premature end of
script headers: /home/fredde/projects/ruby/rails/public/dispatch.cgi


For some reason 'ActionController::Base.logger' is nil. I don't see
anywhere it is initialized either so I'm not sure what I'm missing.

Have I forgot something?

//F
 
D

David Heinemeier Hansson

Check the permissions on your log directory and log file and make sure
that the www-data user (or whatever apache runs as) can write to those
directories.

This stymied me for a while as well.

This has been one of the top "stymizers" for people and a constant
source of questions on #rubyonrails. I'll make sure to rectify this
shortly! An obscure and untraceable error for something that should be
very simple. Bad Rails, Baaaad Rails! ;)
--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top