Learning Rails
Learning Rails By Simon St. Laurent, Edd Dumbill
November 2008
Pages: 442


Welcome Guest ( Log In | Register )

Running Sample Code?
Local_Orbit
post Jun 11 2009, 10:41 PM
Post #1


New Member
*

Group: Members
Posts: 4
Joined: 3-June 09
Member No.: 18,457



I admit it, I got lazy with the typing and let a few chapters slip by without actually keeping my local guestbook app caught up with the code samples. Now I'd like to run the code samples provided on this site, but I'm running into trouble.

The first problem was my rails version number, as defined in environment.rb. I updated:

"RAILS_GEM_VERSION = '2.0.2' unless defined? RAILS_GEM_VERSION"

to:

"RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION"

Next, I had to change "controllers/application.rb" to controllers/application_controller.rb"

Now I think I'm having trouble with migrations. I had a db table built from ~chapter 6 or so (now chapter 8), and I began by running "rake db:rollback" a few times. Then I ran "rake db:migrate" and tried to run the app. All's well and good, until I tried "new person." This throws an exception to the tune of:

"ActionController::RoutingError in People#new

Showing app/views/people/_form.html.erb where line #5 raised:

person_url failed to generate from {:controller=>"people", :action=>"show", :id=>#<Person id: nil, name: nil, secret: nil, country: nil, email: nil, description: nil, can_send_email: nil, graduation_year: nil, body_temperature: nil, price: nil, birthday: nil, favorite_time: nil, created_at: nil, updated_at: nil, extension: nil>}, expected: {:controller=>"people", :action=>"show"}, diff: {:id=>#<Person id: nil, name: nil, secret: nil, country: nil, email: nil, description: nil, can_send_email: nil, graduation_year: nil, body_temperature: nil, price: nil, birthday: nil, favorite_time: nil, created_at: nil, updated_at: nil, extension: nil>}"

What's my next move here? Or just yell at me for being lazy, that's cool too.
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

RSS Lo-Fi Version Time is now: 23rd November 2009 - 04:26 AM