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!
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 »
- How to Get MagicJack and Lifecam Cinema Working on Windows 7 64-bit
- Fix for Error Installing do_mysql Datamapper Adapter on Ubuntu
- Amazon Packages and Ships OEM Hard Drives Loose in Box with Two Air Pillows and Bubble Wrap ONLY
- Devious New Targeted Financial Phishing Scam Strikes Your Cellphone
- Errata for Programming Collective Intelligence
- Yelp Battles Supporters of the Meier Family
- Pictures of Lori Drew
- Picture of Curt Drew
- Brandon Antron Rolle Goes on Trial Today
- Fixing Spurious Rails Routing Error




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.
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!
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!
September 3rd, 2008 00:37
yes , rebooting the server will fix it