# Debugging a routing error

**URL:** <https://www.ruby-forum.com/t/debugging-a-routing-error/109432>\
**Category:** Rails\
**Created:** [July 14, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/debugging-a-routing-error/109432 "2007-07-14T20:47:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@ming](https://www.ruby-forum.com/u/ming)\
**Post date:** [July 14, 2007, 8:47pm UTC](https://www.ruby-forum.com/t/debugging-a-routing-error/109432/1 "2007-07-14T20:47:23Z")

</div>

How do I debug a routing error?

I’ve been running examples from the Agile Rails book just fine to the  
end of Chapter 8, cart creation. Then the next morning my installation  
stopped working.

“no route found to match “/store” with {:method=\>:get}”

attempting to debug:

> > rs = ActionController::Routing::Routes  
> > rs.recognize\_path “/store”  
> > =\> {:controller=\>“store”, :action=\>“index”}

the problem persists despite making the suggestion of changing

root\_path = Pathname.new(root\_path).cleanpath(true).to\_s

in config/boot.rb for my rails 1.2.3 installation.

TIA

---

<div class="post-metadata">

**Author:** ![ming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@ming](https://www.ruby-forum.com/u/ming)\
**Post date:** [July 14, 2007, 8:58pm UTC](https://www.ruby-forum.com/t/debugging-a-routing-error/109432/2 "2007-07-14T20:58:24Z")

</div>

Ming -

On 14-Jul-07, at 2:46 PM, Ming wrote:

> TIA  
> I’ve found Rick’s routing\_navigator[1] plugin to be helpful.

Plus topfunky’s “REST Cheetsheet”[2] is a darling.

Jodi

[1] [http://svn.techno-weenie.net/projects/plugins/routing\_navigator/](http://svn.techno-weenie.net/projects/plugins/routing_navigator/)  
[2] [http://topfunky.com/clients/peepcode/REST-cheatsheet.pdf](http://topfunky.com/clients/peepcode/REST-cheatsheet.pdf)

---

<div class="post-metadata">

**Author:** ![ming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@ming](https://www.ruby-forum.com/u/ming)\
**Post date:** [July 14, 2007, 9:16pm UTC](https://www.ruby-forum.com/t/debugging-a-routing-error/109432/3 "2007-07-14T21:16:50Z")

</div>

what does your routes.rb look like?

> “no route found to match “/store” with {:method=\>:get}”
> 
> attempting to debug:
> 
> > > rs = ActionController::Routing::Routes  
> > > rs.recognize\_path “/store”  
> > > =\> {:controller=\>“store”, :action=\>“index”}

---

<div class="post-metadata">

**Author:** ![ming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@ming](https://www.ruby-forum.com/u/ming)\
**Post date:** [July 15, 2007, 10:47am UTC](https://www.ruby-forum.com/t/debugging-a-routing-error/109432/4 "2007-07-15T10:47:17Z")

</div>

Jodi -

The pdf looks really cool… though at this stage of my railship, i’m  
not sure what to make of it…

I might to install Edge Rails and Rick’s routing\_navigator plugin to  
get to the root of my problem

thanks.

---

<div class="post-metadata">

**Author:** ![ming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@ming](https://www.ruby-forum.com/u/ming)\
**Post date:** [July 15, 2007, 10:46am UTC](https://www.ruby-forum.com/t/debugging-a-routing-error/109432/5 "2007-07-15T10:46:17Z")

</div>

routes.rb:

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

On Jul 14, 3:16 pm, Matthew R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![ming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@ming](https://www.ruby-forum.com/u/ming)\
**Post date:** [July 15, 2007, 8:34pm UTC](https://www.ruby-forum.com/t/debugging-a-routing-error/109432/6 "2007-07-15T20:34:13Z")

</div>

i fixed the problem by uninstalling and reinstalling the rails gem.

apparently i have a version of the elsewhere reported spurious routes  
for rails 1.2.3 that doesn’t get fixed by adding realpath to  
root\_path:

root\_path = Pathname.new(root\_path).cleanpath(true).realpath().to\_s

thanks to all who responded.

---

<div class="post-metadata">

**Author:** ![ming](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/71c47a/32.png) [@ming](https://www.ruby-forum.com/u/ming)\
**Post date:** [July 15, 2007, 10:48am UTC](https://www.ruby-forum.com/t/debugging-a-routing-error/109432/7 "2007-07-15T10:48:17Z")

</div>

i meant to say that in boot.rb i changed

root\_path = Pathname.new(root\_path).cleanpath(true).to\_s

to

root\_path = Pathname.new(root\_path).cleanpath(true).realpath().to\_s

per

[http://thenoobonrails.blogspot.com/2007/06/rails-12x-routing-issues.html](http://thenoobonrails.blogspot.com/2007/06/rails-12x-routing-issues.html)

this has not helped…
