Can't get rails to work

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

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
Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern. ?

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

regards,

Martin

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 Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.. 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 :slight_smile:

···

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

Fredrik Jagenheim wrote:

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:

Have I forgot something?

I'm still learning rails myself, but I think foo is the controller, and you need an action to call on it: http://rails/foo/bar

Fredrik Jagenheim wrote:

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.

···

--
-- Jim Weirich jim@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

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 Ruby on Rails — A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.

regards,

Martin

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

Fredrik Jagenheim wrote:

···

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

--
Daniel Hobe <daniel@nightrunner.com>
http://www.nightrunner.com

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! :wink:

···

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