Routing error

Routing Error

No route matches “/cookbook” with {:method=>:get}

This problem started this morning, whereas it was working last night.
Occurring with all projects. No routing.rb files were changed by me.

I’m using InstantRails/Sqlite3 and Mongrel.

I don’t even know how to start diagnosing this. I’m a noob. Taking a
class. Mongrel base page comes up fine.

Any help appreciated.

On Sat, Jul 18, 2009 at 9:26 PM, Dwight
Shackelford[email protected] wrote:

No route matches “/cookbook” with {:method=>:get}

I don’t even know how to start diagnosing this.

Do all your unit/rspec tests still pass?

Are there any errors in your logs?

What does rake routes show?


Hassan S. ------------------------ [email protected]
twitter: @hassan

Hassan S. wrote:

On Sat, Jul 18, 2009 at 9:26 PM, Dwight
Shackelford[email protected] wrote:

No route matches “/cookbook” with {:method=>:get}

I don’t even know how to start diagnosing this.

Do all your unit/rspec tests still pass?

Don’t know what that means. I’m pretty new at this.

Are there any errors in your logs?

I wiped the logs, because data from differing projects were getting
written to multiple logs, meaning a specific log under a specific
subdirectory included data from other projects too. To get a clean run,
I truncated them. Cookbook runs now. Phonebook did not, and no log was
written for the attempt to run it. Not that I can find.

What does rake routes show?

This is for phonebook

(in C:/InstantRails/rails_apps/phonebook)
phonebooks GET /phonebooks
{:action=>“index”, :controller=>“phonebooks”}
formatted_phonebooks GET /phonebooks.:format
{:action=>“index”, :controller=>“phonebooks”}
POST /phonebooks
{:action=>“create”, :controller=>“phonebooks”}
POST /phonebooks.:format
{:action=>“create”, :controller=>“phonebooks”}
new_phonebook GET /phonebooks/new
{:action=>“new”, :controller=>“phonebooks”}
formatted_new_phonebook GET /phonebooks/new.:format
{:action=>“new”, :controller=>“phonebooks”}
edit_phonebook GET /phonebooks/:id/edit
{:action=>“edit”, :controller=>“phonebooks”}
formatted_edit_phonebook GET /phonebooks/:id/edit.:format
{:action=>“edit”, :controller=>“phonebooks”}
phonebook GET /phonebooks/:id
{:action=>“show”, :controller=>“phonebooks”}
formatted_phonebook GET /phonebooks/:id.:format
{:action=>“show”, :controller=>“phonebooks”}
PUT /phonebooks/:id
{:action=>“update”, :controller=>“phonebooks”}
PUT /phonebooks/:id.:format
{:action=>“update”, :controller=>“phonebooks”}
DELETE /phonebooks/:id
{:action=>“destroy”, :controller=>“phonebooks”}
DELETE /phonebooks/:id.:format
{:action=>“destroy”, :controller=>“phonebooks”}
/:controller/:action/:id
/:controller/:action/:id.:format

I wiped the logs, because data from differing projects were getting
written to multiple logs, meaning a specific log under a specific
subdirectory included data from other projects too. To get a clean run,
I truncated them. Cookbook runs now. Phonebook did not, and no log was
written for the attempt to run it. Not that I can find.

Cookbook crashed again. Here’s the log, or the last part of the log:

Rendering
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb
(not_found)

Processing ApplicationController#index (for 127.0.0.1 at 2009-07-18
22:43:06) [GET]
Session ID:
BAh7BiIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNo%0ASGFzaHsABjoKQHVzZWR7AA%3D%3D–1fcc8bed80c5349246099b22244d1f5831fe8285
Parameters: {}

ActionController::RoutingError (No route matches “/cookbooks” with
{:method=>:get}):
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1441:in
recognize_path' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/routing.rb:1424:inrecognize’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:170:in
handle_request' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:115:indispatch’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:126:in
dispatch_cgi' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/dispatcher.rb:9:indispatch’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/…/lib/mongrel/rails.rb:76:in
process' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel/rails.rb:74:insynchronize’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/…/lib/mongrel/rails.rb:74:in
process' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel.rb:159:inprocess_client’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/…/lib/mongrel.rb:158:in
each' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel.rb:158:inprocess_client’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/…/lib/mongrel.rb:285:in
run' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel.rb:285:ininitialize’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/…/lib/mongrel.rb:285:in
new' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel.rb:285:inrun’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/…/lib/mongrel.rb:268:in
initialize' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel.rb:268:innew’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/…/lib/mongrel.rb:268:in
run' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel/configurator.rb:282:inrun’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/…/lib/mongrel/configurator.rb:281:in
each' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel/configurator.rb:281:inrun’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/mongrel_rails:128:in
run' C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/../lib/mongrel/command.rb:212:inrun’
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.2-x86-mswin32/bin/mongrel_rails:281
C:/INSTAN~2/ruby/bin/mongrel_rails:19:in `load’
C:/INSTAN~2/ruby/bin/mongrel_rails:19

Rendering
C:/INSTAN~2/ruby/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/action_controller/templates/rescues/layout.erb
(not_found)

Hassan S. wrote:

On Sat, Jul 18, 2009 at 10:46 PM, Dwight
Shackelford[email protected] wrote:

Cookbook crashed again. �Here’s the log, or the last part of the log:

ActionController::RoutingError (No route matches “/cookbooks” with
{:method=>:get}):

OK, so what does rake routes for this application show?

(in C:/InstantRails/rails_apps/cookbook)
categories GET /categories
{:action=>“index”, :controller=>“categories”}
formatted_categories GET /categories.:format
{:action=>“index”, :controller=>“categories”}
POST /categories
{:action=>“create”, :controller=>“categories”}
POST /categories.:format
{:action=>“create”, :controller=>“categories”}
new_category GET /categories/new
{:action=>“new”, :controller=>“categories”}
formatted_new_category GET /categories/new.:format
{:action=>“new”, :controller=>“categories”}
edit_category GET /categories/:id/edit
{:action=>“edit”, :controller=>“categories”}
formatted_edit_category GET /categories/:id/edit.:format
{:action=>“edit”, :controller=>“categories”}
category GET /categories/:id
{:action=>“show”, :controller=>“categories”}
formatted_category GET /categories/:id.:format
{:action=>“show”, :controller=>“categories”}
PUT /categories/:id
{:action=>“update”, :controller=>“categories”}
PUT /categories/:id.:format
{:action=>“update”, :controller=>“categories”}
DELETE /categories/:id
{:action=>“destroy”, :controller=>“categories”}
DELETE /categories/:id.:format
{:action=>“destroy”, :controller=>“categories”}
recipes GET /recipes
{:action=>“index”, :controller=>“recipes”}
formatted_recipes GET /recipes.:format
{:action=>“index”, :controller=>“recipes”}
POST /recipes
{:action=>“create”, :controller=>“recipes”}
POST /recipes.:format
{:action=>“create”, :controller=>“recipes”}
new_recipe GET /recipes/new
{:action=>“new”, :controller=>“recipes”}
formatted_new_recipe GET /recipes/new.:format
{:action=>“new”, :controller=>“recipes”}
edit_recipe GET /recipes/:id/edit
{:action=>“edit”, :controller=>“recipes”}
formatted_edit_recipe GET /recipes/:id/edit.:format
{:action=>“edit”, :controller=>“recipes”}
recipe GET /recipes/:id
{:action=>“show”, :controller=>“recipes”}
formatted_recipe GET /recipes/:id.:format
{:action=>“show”, :controller=>“recipes”}
PUT /recipes/:id
{:action=>“update”, :controller=>“recipes”}
PUT /recipes/:id.:format
{:action=>“update”, :controller=>“recipes”}
DELETE /recipes/:id
{:action=>“destroy”, :controller=>“recipes”}
DELETE /recipes/:id.:format
{:action=>“destroy”, :controller=>“recipes”}
root /
{:action=>“index”, :controller=>“categories”}
/:controller/:action/:id
/:controller/:action/:id.:format

On Sat, Jul 18, 2009 at 10:57 PM, Dwight
Shackelford[email protected] wrote:

ActionController::RoutingError (No route matches “/cookbooks” with
{:method=>:get}):

OK, so what does rake routes for this application show?

(in C:/InstantRails/rails_apps/cookbook)

o-tay – so exactly as the error message says, there’s no route
“/cookbooks”. That seems like a pretty unambiguous indicator :slight_smile:

So where and why are you calling that?


Hassan S. ------------------------ [email protected]
twitter: @hassan

On Sat, Jul 18, 2009 at 10:46 PM, Dwight
Shackelford[email protected] wrote:

Cookbook crashed again. Here’s the log, or the last part of the log:

ActionController::RoutingError (No route matches “/cookbooks” with
{:method=>:get}):

OK, so what does rake routes for this application show?


Hassan S. ------------------------ [email protected]
twitter: @hassan

Hassan S. wrote:

On Sat, Jul 18, 2009 at 10:57 PM, Dwight
Shackelford[email protected] wrote:

ActionController::RoutingError (No route matches “/cookbooks” with
{:method=>:get}):

OK, so what does rake routes for this application show?

(in C:/InstantRails/rails_apps/cookbook)

o-tay – so exactly as the error message says, there’s no route
“/cookbooks”. That seems like a pretty unambiguous indicator :slight_smile:

So where and why are you calling that?


Hassan S. ------------------------ [email protected]
twitter: @hassan

Looks like this is what brings up cookbooks: http://localhost:3001/

not http://localhost:3001/cookbooks

I’ll try to work on this tomorrow, with one of the projects I wrote.
Cookbook came with the app. Thanks for your help so far. Let me get a
bit more focused.

Dwight S. wrote:

Hassan S. wrote:

On Sat, Jul 18, 2009 at 9:26 PM, Dwight
Shackelford[email protected] wrote:

No route matches “/cookbook” with {:method=>:get}

I don’t even know how to start diagnosing this.

Do all your unit/rspec tests still pass?

Don’t know what that means. I’m pretty new at this.
[…]

Whether you’re new or not, you should be aware of Rails’ testing tools,
and you should be constantly writing tests, preferably before you write
the code. If you really don’t know what Rails unit tests and/or RSpec
specs are, then you must learn about these before you write even one
more line
of application code. This is essential to good development
practice.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

James B. wrote:

Dwight S. wrote:

I wiped the logs, because data from differing projects were getting
written to multiple logs, meaning a specific log under a specific
subdirectory included data from other projects too. To get a clean run,
I truncated them. Cookbook runs now. Phonebook did not, and no log was
written for the attempt to run it. Not that I can find.

I am curious about this statement. How did you arrange to have
different projects write to the same log/development log? You do not
have multiple Rails projects in the same root directory perchance?

Don’t know how it happened. There’s duplicate log files under the
separate projects.

InstantRails sort of enforces the following directory structure:

C:\InstantRails\Rails_Apps[Project1]
C:\InstantRails\Rails_Apps[Project2]
C:\InstantRails\Rails_Apps[Project3]
etc.

Except the log files under the different projects seem to contain the
same info.

InstantRails has a button that says “Start project with Mongrel”. I’ll
sometimes hit that, just to get Mongrel listening, then from the web
page pull up different projects. Not sure if that’s the issue or not.

Dwight S. wrote:

InstantRails has a button that says “Start project with Mongrel”. I’ll
sometimes hit that, just to get Mongrel listening, then from the web
page pull up different projects. Not sure if that’s the issue or not.

Just to double check the obvious, when you start the mongrel cluster are
you sure that you are starting it in the correct (cookbook) project root
directory every time?

James B. wrote:

Dwight S. wrote:

InstantRails has a button that says “Start project with Mongrel”. I’ll
sometimes hit that, just to get Mongrel listening, then from the web
page pull up different projects. Not sure if that’s the issue or not.

Just to double check the obvious, when you start the mongrel cluster are
you sure that you are starting it in the correct (cookbook) project root
directory every time?

Well, cookbook is not one I wrote, but sometimes it is the only one
Mongrel will start for. I just thought that it started Mongrel. Didn’t
know it was starting it specifically for a certain subdirectory.

What is the mechanism behind that? What do I check to see where Mongrel
is listening?

I started two weeks late into a 5 week class. What you’re witnessing is
thrashing.

Dwight S. wrote:

I wiped the logs, because data from differing projects were getting
written to multiple logs, meaning a specific log under a specific
subdirectory included data from other projects too. To get a clean run,
I truncated them. Cookbook runs now. Phonebook did not, and no log was
written for the attempt to run it. Not that I can find.

I am curious about this statement. How did you arrange to have
different projects write to the same log/development log? You do not
have multiple Rails projects in the same root directory perchance?

Dwight S. wrote:
[…]

I started two weeks late into a 5 week class.

A class in Rails development, I take it?

What you’re witnessing is
thrashing.

Then please…talk to your instructor. Spend your time on that, not
just posting on the list.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Dwight S. wrote:

Well, cookbook is not one I wrote, but sometimes it is the only one
Mongrel will start for. I just thought that it started Mongrel. Didn’t
know it was starting it specifically for a certain subdirectory.

What is the mechanism behind that? What do I check to see where Mongrel
is listening?

I started two weeks late into a 5 week class. What you’re witnessing is
thrashing.

Start here:

READ it all. It is old and out of date, but is so generic that this
barely matters. Then, either set up a Rails project from scratch
following the tutorial or connect with somebody that has at least a
passing familiarity with the framework and have them do it with you.

If mongrel will not start for any project other than cookbook then your
problem is that each of the other projects has a fatal error that
prevents the server from starting. When this happens the cause is sent
to stderr which, if you are starting it from a virtual terminal session,
will be your display. Follow the stack trace to locate the problem.

But, do the tutorial first.

James B. wrote:

Start here:
Ruby on Rails - Introduction

READ it all. It is old and out of date, but is so generic that this
barely matters. Then, either set up a Rails project from scratch
following the tutorial or connect with somebody that has at least a
passing familiarity with the framework and have them do it with you.

If mongrel will not start for any project other than cookbook then your
problem is that each of the other projects has a fatal error that
prevents the server from starting. When this happens the cause is sent
to stderr which, if you are starting it from a virtual terminal session,
will be your display. Follow the stack trace to locate the problem.

But, do the tutorial first.

Thanks James. Appreciate it.

Marnen Laibow-Koser wrote:

Dwight S. wrote:
[…]

I started two weeks late into a 5 week class.

A class in Rails development, I take it?

What you’re witnessing is
thrashing.

Then please…talk to your instructor. Spend your time on that, not
just posting on the list.

It’s an online class. Instructor access is limited.

Regarding posting on this list, it’s another avenue for me to get some
info. Like the tutorial above. Things like InstantRails don’t really
have a manual that I can look a bunch of stuff up in.