# Help geting started

**URL:** <https://www.ruby-forum.com/t/help-geting-started/193108>\
**Category:** Rails\
**Created:** [August 11, 2010, 12:15pm UTC](https://www.ruby-forum.com/t/help-geting-started/193108 "2010-08-11T12:15:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![neigaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@neigaard](https://www.ruby-forum.com/u/neigaard)\
**Post date:** [August 11, 2010, 12:15pm UTC](https://www.ruby-forum.com/t/help-geting-started/193108/1 "2010-08-11T12:15:01Z")

</div>

Hi

I am reading O’Reilly Rails Cookbook, but I can not get the examples  
working. Here is what I have done so far:

rails mytest --database=mysql

ruby script/generate migration build\_db  
–BuildDb class–  
class BuildDb \< ActiveRecord::Migration  
def self.up  
create\_table :schedules, :force =\> true do |t|  
t.column :scheduleTime, :datetime  
t.column :repeatEveryYear, :boolean  
t.column :message, :string

```
  t.timestamps
end

```

end

def self.down  
drop\_table :schedules  
end  
end  
–BuildDb class–

rake db:migrate

ruby script/generate model schedules (generates a new empty migration,  
I deleted it)

ruby script/generate controller schedules

Edited my controller, and added: scaffold :schedules

But when I try to test my application, the mongrel log gives me this:

Wed Aug 11 12:06:10 +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

Hm well should this not work?

Thank you  
Søren

---

<div class="post-metadata">

**Author:** ![neigaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@neigaard](https://www.ruby-forum.com/u/neigaard)\
**Post date:** [August 11, 2010, 12:22pm UTC](https://www.ruby-forum.com/t/help-geting-started/193108/2 "2010-08-11T12:22:03Z")

</div>

On 11 August 2010 11:13, neigaard [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

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

---

<div class="post-metadata">

**Author:** ![neigaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@neigaard](https://www.ruby-forum.com/u/neigaard)\
**Post date:** [August 11, 2010, 12:49pm UTC](https://www.ruby-forum.com/t/help-geting-started/193108/3 "2010-08-11T12:49:28Z")

</div>

neigaard wrote:

> Hi
> 
> I am reading O’Reilly Rails Cookbook, but I can not get the examples  
> working. Here is what I have done so far:
> 
> rails mytest --database=mysql

Maybe you should start Rails learning by following  
‘[http://guides.rubyonrails.org/](http://guides.rubyonrails.org/)’ site.

Thanks,  
Anubhaw

---

<div class="post-metadata">

**Author:** ![neigaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@neigaard](https://www.ruby-forum.com/u/neigaard)\
**Post date:** [August 11, 2010, 2:39pm UTC](https://www.ruby-forum.com/t/help-geting-started/193108/4 "2010-08-11T14:39:38Z")

</div>

On 08/11/2010 12:13 PM, neigaard wrote:

> Hi
> 
> 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”.

Cheers,

Jan

---

<div class="post-metadata">

**Author:** ![neigaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@neigaard](https://www.ruby-forum.com/u/neigaard)\
**Post date:** [August 13, 2010, 12:22pm UTC](https://www.ruby-forum.com/t/help-geting-started/193108/5 "2010-08-13T12:22:53Z")

</div>

Well, I am now reading

> **[Getting Started with Rails — Ruby on Rails Guides](https://guides.rubyonrails.org/getting_started.html)**
>
> Getting Started with RailsThis guide covers getting up and running with Ruby on Rails.After reading this guide, you will know: How to install Rails, create a new Rails application, and connect your application to a database. The general layout of a...

(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](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?

Thank you  
Søren

---

<div class="post-metadata">

**Author:** ![neigaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@neigaard](https://www.ruby-forum.com/u/neigaard)\
**Post date:** [August 14, 2010, 10:02pm UTC](https://www.ruby-forum.com/t/help-geting-started/193108/6 "2010-08-14T22:02:18Z")

</div>

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:

sudo gem uninstall fastthread  
sudo gem uninstall mongrel  
sudo gem install mongrel

But still I get the same error with mongrel. Well I can work with  
webrick, but I sure would like to know what is wrong with my mongrel.

Thank you  
Søren

---

<div class="post-metadata">

**Author:** ![neigaard](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/41988e/32.png) [@neigaard](https://www.ruby-forum.com/u/neigaard)\
**Post date:** [August 13, 2010, 3:53pm UTC](https://www.ruby-forum.com/t/help-geting-started/193108/7 "2010-08-13T15:53:03Z")

</div>

you can also take a look at this [Chapter 1: From zero to deploy | Ruby on Rails Tutorial | Learn Enough to Be Dangerous](http://railstutorial.org/book)

[http://railstutorial.org/book](http://railstutorial.org/book)as far as you environment being broken  
that’s  
hard to tell without more information
