talideon.com

Bless me Father, for I have sinned; I poked a badger with a spoon

July 11, 2007 at 4:46PM Getting spurious “no route found to match” with Rails 1.2.3?

Open up config/boot.rb and change the line reading:

root_path = Pathname.new(root_path).cleanpath(true).to_s

to:

root_path = Pathname.new(root_path).cleanpath(true).realpath().to_s

...which will fully canonicalise the application root path into an abolute path. This will solve problems where Rails can’t find controller methods using the default route patterns.

It took me the best part of a day to figure out what was going on with this, damnit!

Update (October 22nd): Additionally, if all the feedback you’re getting from Rails is “Rails application failed to start properly” and you’re having difficulty figuring out why Rails won’t run, ssh into the webserver and run the site’s public/dispatch.cgi file. It should throw an exception explaining the problem. Unfortunately, there seem to be a number of circumstances in which Rails can’t log exceptions, one of which is when plug-ins are being loaded, as I discovered today.

Technorati Search Technorati Search Irish Bloggers

Comments

1 On July 11, 2007 at 17:19, Revence wrote:

At least you blogged it. Now, someone’s posterior done been saved.

Although I must confess I think there is something wrong with me. After having been doing Ruby for so bloody long, I have never written a Rails app. God. Should apt-get install rails already. Just so I know what everyone’s buzzing about.

All I do is scripting tasks. Basically, I figured I’d replace Perl with Ruby while I wait for Perl 6. Should try Rails.

2 On July 13, 2007 at 13:42, Laura Czajkowski wrote:

I’m sure it was a productive day :)

3 On October 20, 2007 at 23:47, Rupak Ganguly wrote:

Dude, it was such a relief to see your post. I have already spent 2 hours at it. Bless your soul.

4 On October 22, 2007 at 17:29, Keith wrote:

Glad it helped, Rupak.

Post a comment

All form information is optional, but it’s a good idea to fill in your name and email address if you want me to take your comment seriously.

Spammers, don’t bother posting crap down here. The site is set up so that legitimate search engines (Google, for instance) won’t index pages with comments on them. Posting crud here only means you’re wasting my time and patience. Shoo!

Real names, please. Please include!
Won’t be displayed. Please include!
Displayed, if present.