Fixing Spurious Rails Routing Error

Rails stopped routing http requests the morning after everything was working fine. I was running demo exercises from the Agile Rails book and didn't seem to do anything that could have messed up the installation. Downloading and symlinking to the books own app code didn't fix the problem.

"no route found to match "/store" with {:method=>:get}"

attempting to debug:

>> rs = ActionController::Routing::Routes
>> rs.recognize_path "/store"
=> {:controller=>"store", :action=>"index"}

routes.rb seems fine:

ActionController::Routing::Routes.draw do |map|
map.connect ':controller/:action/:id.:format'
map.connect ':controller/:action/:id'
end

Everything looks good where is the problem? I googled and found a post pointing out spurious routing problems in Rails 1.2.3 and a suggestion to change boot.rb to remedy it:

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

to

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

That suggestion did not work for me. Desperate to get my Rails show back on the road, I did the obvious:

gem uninstall rails
gem install rails

Bingo!

Share and Enjoy:
  • del.icio.us
  • digg
  • NewsVine
  • Reddit
  • TailRank


Thank you for reading this post. You can now Read Comments (4) or Leave A Trackback.

Post Info

This entry was posted on Sunday, July 15th, 2007 and is filed under software.

You can follow any responses to this entry through the Comments Feed. You can Leave A Comment, or A Trackback.



Previous Post: MySpace Stumbles Playing Catchup to Facebook with Status Updates “Friendsmoods” »
Next Post: Brandon Antron Rolle Goes on Trial Today »

Read More

Related Reading:

4 Responses to “Fixing Spurious Rails Routing Error

  • 1
    Sean
    July 24th, 2007 14:28

    Thanks! I actually made a pretty dumb newbie mistake: I kept trying the path using the folder name instead of the controller name. Oops! Well at least I now have the most current version of Rails.

  • 2
    Paul
    December 12th, 2007 19:13

    Im new to rails too and also came across this error after creating new controllers. I discovered that a simple restart of the WEBrick server worked!

  • 3
    jerry
    August 2nd, 2008 12:02

    Yes, a restart of the server will do it!

    I had this problem, and I didn’t remember when I was working with rails a few months ago on someone else project, using mongrel. anytime a controller was changed, we had to restart the webserver to get it to take effect!

  • 4
    Singh
    September 3rd, 2008 00:37

    yes , rebooting the server will fix it



Leave a Reply

Note: Any comments are permitted only because the site owner is letting you post, and any comments will be removed for any reason at the absolute discretion of the site owner.

forum seo