Category: Rails

10/23/05

Permalink 10:07:15 am, Categories: Rails, 340 words   English (US)

Steel rails through my skull

So I'm reading through a really good Rails programming book. I'll be installing it for a client so I figure the more I know about the language the better.

The book says to create a new scaffold for its first sample application with the command:

ruby script/generate scaffold Product Admin

And as usual I am lucky enough to have problems at this stage. That's supposed to give me a web page I can use to view a MySQL shopping cart. But whenever I went to the URL I would get a 'Recognition failed' error. Not knowing anything about Ruby or Rails, I had no clue what this meant, so I'm searching logfiles, wondering whether there is a problem with my database setup, etc.

Searching on google led to an errata page for the Agile programming book, which seemed to indicate this issue. Of course the site has to be down and the google cache useless so I get nothing out of this.

After doing some reading, I found out that the above command is supposed to create an Admin controller of type Product. But it wasn't doing that, and instead creating a 'products' controller and ignoring the Admin argument altogether. So the recognition failed message means it couldn't find the controller. After about 30 min of searching the web, it turns out I came across a bug that was fixed 10 hours ago.

I was using rails version 0.14.1, which has this problem, and it's suggested to go down to 0.13 or the development code. After going to 0.13.1 (via 'gem install rails --version 0.13.1'), and removing the new version, things worked ok. Ahh the joys of version hell. Don't get me wrong, Rails looks very cool, but these type of issues remind me of all the problems associated with Java versions. I understand Rails is under heavy development, and I should probably stick to older versions. But with things such as 'gem install rails' installing something broken, how could I know?

Oh well, I got this working and will continue my Rails adventure later.

Viraj's Weblog

This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

August 2010
Mon Tue Wed Thu Fri Sat Sun
<<  <   >  >>
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Search

Categories


Misc

Syndicate this blog XML

What is RSS?

powered by
b2evolution