I don’t think the stack problem I’m having is a result of code I wrote.
That’s because I haven’t written any code, per se My current
hypothesis
is that I either have something wrong installed, or something installed
wrong.
My current config (as reported by ‘ruby -v’, ‘gem -v’, ‘rails -v’,
‘mysql
\s’ and ‘ruby script\server’) is:
Ruby: 1.8.2 (2004-12-25) [i386-mswin32]
gem: 0.8.3
Rails: 0.14.3
MySQL: 4.1.16-nt
WEBrick: 1.3.1
The article I referred to is “Rolling with Ruby on Rails.” It’s at:
WRT background info, I’m working through it on a fresh Win2K
installation.
The RoR install went fairly well. The only significant problem I had
was
with the Rails install. Apparently the gems package that ships with the
Windows installer is out of date and I had to bring it up to date with a
“gems install rails -v 0.14.3”. That got me to a “Rails installed
successfully” message.
The only config issue that jumped out at me was that the article
instructed me to ‘Download the latest “essential” version of of the
MySQL
Windows installer (Currently, that is Windows Essentials (x86) 4.1.7)’.
ALL
the versions available for download at
dev.mysql.com/downloads/mysql/4.1.html are 4.1.16, not 4.1.7. Initially
I
thought that the version info at mysql.com was a typo. Now I’m not so
sure.
The article took me through using Rails to generate a simple controller
to
display text on a web page just fine. The problem showed up with the
use of
the database.
I set up the database, table, and fields per the article with no problem
(There was one surprise in that the article included an “important note”
to
the effect that MySQL would name the primary key ‘Id’ and I’d need to
change
it to ‘id’ to make Rails happy. In fact, MySQL named it ‘id’ so I
didn’t
need to change it.)
I used ‘ruby script\generate model Recipe’ and ‘ruby script\generate
controller Recipe’ and the expected files (per the article) were
generated.
Pointing my browser at ‘http://127.0.0.1:3000/recipe/new’ resulted in a
page
being displayed with the message
“Unknown action
no action responded to new”
That’s pretty much what I expected.
The stack problem happened when I added the ‘scaffold :recipe’ line to
‘recipe_controller.rb’ Pointing my browser to the same URL now
generates
the error page. It looks like somewhere over 1000 identical lines of
“c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.13.0/lib/active_record/callba
cks.rb:236:in `initialize_without_callbacks’”. That section is followed
by
a 40-50 calls that include webrick. The last line of the error message
says
“script/server:3” I can send along the page itself with all the calls
listed if that’s of any help.
Does any of this help? I’m pretty impressed with RoR based on the
article.
Now if I could only get it to WORK ;-(
Thanks in advance to anyone who can help.
Best regards,
Bill
----- Original Message -----
From: “Bill K.” [email protected]
To: [email protected]
Sent: Monday, January 02, 2006 5:44 AM
Subject: Re: [Rails] Newbie problem with RoR - stack level too deep
On 1/2/06, Bill W. [email protected] wrote:
I’m new to Ruby and Rails and am working through the Curt H.
article.
I created the model and controller per the article but I’m getting an
error
message (title: SystemStackError in Recipe#new; message: stack level
too