I am reading O’Reilly Rails Cookbook, but I can not get the examples
working.
That’s not really a beginners tutorial book - it’s more for reference
on how to deal with specific problems.
You may be better off with a book like “Agile Web D. With
Rails”, which does take you through from first principles.
Also, I’m not sure how up-to-date the Cookbook is (mine’s for Rails
1.2 I think!), and it looks like you’re running 2.3.8, so that may be
part of the problems you’re having.
I am reading O’Reilly Rails Cookbook, but I can not get the examples
working. Here is what I have done so far:
Hey,
I also just started learning rails. First I’ve read “The well grounded
Rubyist” to learn the language itself and now I’m reading “Agile Web
Development with Rails”.
(also tried Agile Web D. with Rails), but I do not get very
far. I follow the guide to chapter 4.1, but when I point my browser to http://localhost:3000/home/index I get a blank page and the following
in mongrel.log:
Fri Aug 13 12:20:22 +0200 2010: Error calling Dispatcher.dispatch
#<NoMethodError: You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.split>
/Users/sneigaard/.gem/ruby/1.8/gems/actionpack-2.3.8/lib/
action_controller/cgi_process.rb:52:in dispatch_cgi' /Users/sneigaard/.gem/ruby/1.8/gems/actionpack-2.3.8/lib/ action_controller/dispatcher.rb:101:in dispatch_cgi’
/Users/sneigaard/.gem/ruby/1.8/gems/actionpack-2.3.8/lib/
action_controller/dispatcher.rb:27:in dispatch' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb: 76:in process’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/rails.rb:
74:in synchronize' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb: 74:in process’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:159:in process_client' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:158:in each’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:158:in process_client' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:285:in initialize' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:285:in new’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:285:in run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in initialize’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel.rb:268:in new' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:268:in run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/
configurator.rb:282:in run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/ configurator.rb:281:in each’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/
configurator.rb:281:in run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in run’
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/…/lib/mongrel/
command.rb:212:in run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 /usr/bin/mongrel_rails:19:in load’
/usr/bin/mongrel_rails:19
Any ideas? Is my rails setup broken? I am runing on OS X 10.6.4, is it
is broken, then how can I uninstall it all and reinstall?
Ok I tested some more, and I found out that it works with the webrick
(ruby script/server webrick) server, so my mongrel must be broken some
how? I did a: