Unable to get past Tutorial 1 in RubyOnRails
On 29 April 2006 I met some one in a Microsoft sponsored developersâ??
community gahering. I was told that ruby on rails is a free software,
easy to use, and in no time will have my mind blown with all the
wonderful prospects and possibilities.
After almost a week, I am still unable to get past tutorial 1 and still
unable to make any tutorials work so far.
I have watched a few videos and demos from the web and I have browsed
through half a book on programming ruby.
I have tried
Encountered some problems such as â??Port 80 for Apache was being used by
some other processâ?, and being unable to connect to my mySql in the
local host.
So I switched to a newer version of the tutorial in
http://instantrails.rubyforge.org/tutorial/index.html
I encountered similar problems.
So, I moved on to try the tutorial in the site
http://rails.homelinux.org/ for 4 days on rails.
I couldnâ??t even get into day 1, so to say.
I also tried the tutorial on
http://wiki.rubyonrails.org/rails/pages/Tutorial and didnâ??t get to point
of â??Congratulations, youâ??re on Rails!â?
I browsed through the 6 part tutorials, but didnâ??t gained much.
After that I went back to
http://instantrails.rubyforge.org/tutorial/index.html
Un-installed and re-installed a few times until I came to the part where
â??Editâ? a recipe was introduced and got stuck.
So, I turned to the Forum for help, stating my problem as best I could.
I was advised to look at the codes in the pre-installed â??cookbookâ?. I
went through the processes and found that each of the step work.
Since the â??Editâ? part didnâ??t work in my exercise in â??cookbook2â?, I
copied the whole folder â??Appâ? from â??cookbookâ? to â??cookbook2â? so the
codes are idential.
I removed the database â??cookcook2â? and used the MySQL-Front 3.2 to
create a new database â??cookbook2â? and check to make sure that the tables
and fields resembled those of the pre-installed â??cookbookâ?.
I was able to log into the website to create the required categories so
that they wouldnâ??t be empty when I tried to create new recipes.
Some one please help!
I was able to to enter the website to create a new recipe, using
http://localhost:3000/recipe/new
Problem came when I pressed to â??Createâ? button.
This brought me to the url: http://localhost:3000/recipe/list
Error message:
NoMethodError in Recipe#list
Showing app/views/recipe/list.rhtml where line #23 raised:
You have a nil object when you didn’t expect it!
The error occured while evaluating nil.name
Extracted source (around line #23):
20:
21:
22:
23: <%= link_to recipe.category.name,
24: :action => “list”,
25: :category => “#{recipe.category.name}” %>
26:
RAILS_ROOT: ./script/…/config/…
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/app/views/recipe/list.rhtml:23
#{RAILS_ROOT}/app/views/recipe/list.rhtml:8
Request
Parameters: None
Show session dump
Response
Headers: {“cookie”=>[], “Cache-Control”=>“no-cache”}