Help: trouble with ONLamp's cookbook tutorial / mysql

I haven't yet touched the tutorial app's code except to change the
database.yml to read:
development:
  adapter: mysql
  database: cookbook
  host: localhost
  ...

Application starts up fine at http://127.0.0.1:3000

When I try to test http://127.0.0.1:3000/recipe/list I get the
following error:
ActiveRecord::StatementInvalid in Recipe#list
Invalid argument: SELECT * FROM recipes

Yet I'm able to query SELECT * FROM recipes in Eclipse's "Instant SQL"
tool and get the correct results.

What could be the problem? I have read somewhere that it could be that
the ruby mysql driver is outdated. Unfortunately I wasn't able to find
one to install. Any ideas?

running on Win XP:
Eclipse 3.1.1, app launched with WEBrick
Instant Rails 1.0 preview 1
Ruby 1.8.2
MySQL 4.1.9

I'm not sure what's going on here. You could try running Instant Rails (
http://instantrails.rubyforge.org/\) which comes with the cookbook app
installed as a sample app and see if it works on your machine.

If you decide to try this, you'll have to stop you currently installation of
MySQL before starting Instant Rails since it tries to start its own copy of
MySQL. Also, if you decide to try this, try it first using WEBrick instead
of the built-in Apache web server like this:

From the main menu (click on the "I" button) select:

Rails Applications >> Manage Rails Applications...

then check the checkbox next to the "cookbook" application and click the
button "Start with WEBrick"

Curt

···

On 10/26/05, lewcio@gmail.com <lewcio@gmail.com> wrote:

I haven't yet touched the tutorial app's code except to change the
database.yml to read:
development:
adapter: mysql
database: cookbook
host: localhost
...

Application starts up fine at http://127.0.0.1:3000

When I try to test http://127.0.0.1:3000/recipe/list I get the
following error:
ActiveRecord::StatementInvalid in Recipe#list
Invalid argument: SELECT * FROM recipes

Yet I'm able to query SELECT * FROM recipes in Eclipse's "Instant SQL"
tool and get the correct results.

What could be the problem? I have read somewhere that it could be that
the ruby mysql driver is outdated. Unfortunately I wasn't able to find
one to install. Any ideas?

running on Win XP:
Eclipse 3.1.1, app launched with WEBrick
Instant Rails 1.0 preview 1
Ruby 1.8.2
MySQL 4.1.9

Excellent, that worked!
I should have mentioned that I am running Instant Rails and its
Cookbook app. Also, I am using IR's MySQL.

Starting WEBrick with IR (as above) works, whereas before I was
starting WEBrick from within Eclipse.

Thanks Curt!

Ahhh...

When you were starting WEBrick from within Eclipse, it was probably not
being run with copy of Ruby included in Instant Rails. The copy of Ruby that
it used may or may not have had all of the needed Rails packages (or proper
versions of them). Just guessing here, but IR's included Rby does have all
the right stuff (pun intended).

Curt

···

On 10/26/05, lewcio@gmail.com <lewcio@gmail.com> wrote:

Excellent, that worked!
I should have mentioned that I am running Instant Rails and its
Cookbook app. Also, I am using IR's MySQL.

Starting WEBrick with IR (as above) works, whereas before I was
starting WEBrick from within Eclipse.

Oh, I didn't realize that Eclipse would have it's own version of Ruby.
A follow-up question, then: would you know how to configure Eclipse to
use IR's Ruby? Or should I just not worry about it and start WEBrick
via IR?

I don't know. I haven't yet used the RDT plugin for Eclipse. I keep meaning
to try it, but haven't yet got around to it.

Curt

···

On 10/26/05, lewcio@gmail.com <lewcio@gmail.com> wrote:

Oh, I didn't realize that Eclipse would have it's own version of Ruby.
A follow-up question, then: would you know how to configure Eclipse to
use IR's Ruby? Or should I just not worry about it and start WEBrick
via IR?

I haven't tried this yet, but I see that the Eclipse global
preferences (Window menu -> Preferences), under the Ruby section, has
a page to set the Ruby interpreter you want to use. (The Java JDT
plugin has the same capability.)

dean

···

On 10/26/05, Curt Hibbs <curt.hibbs@gmail.com> wrote:

On 10/26/05, lewcio@gmail.com <lewcio@gmail.com> wrote:
>
> Oh, I didn't realize that Eclipse would have it's own version of Ruby.
> A follow-up question, then: would you know how to configure Eclipse to
> use IR's Ruby? Or should I just not worry about it and start WEBrick
> via IR?

I don't know. I haven't yet used the RDT plugin for Eclipse. I keep meaning
to try it, but haven't yet got around to it.

Curt

--
Dean Wampler
http://www.aspectprogramming.com

Right on, it's there.
Interestingly, I'm set to InstantRails\bin\ruby.exe.
It works with Curt's method above nevertheless. Thanks guys.

It should be InstantRails\ruby\bin\ruby.exe

···

On 10/26/05, lewcio@gmail.com <lewcio@gmail.com> wrote:

Right on, it's there.
Interestingly, I'm set to InstantRails\bin\ruby.exe.
It works with Curt's method above nevertheless. Thanks guys.

You're right. I mistyped the path.