Routing error

Do all your unit/rspec tests still pass?

Are there any errors in your logs?

What does `rake routes` show?

Hassan Schroeder 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

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

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 Schroeder wrote:

Dwight Shackelford wrote:

Hassan Schroeder 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,

Dwight Shackelford 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?

James Byrne wrote:

Dwight Shackelford 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.

James Byrne wrote:

Dwight Shackelford 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 Shackelford 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,

Dwight Shackelford 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.

Marnen Laibow-Koser wrote:

Dwight Shackelford 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.

James Byrne 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.