help: trouble with ONLamp's cookbook tutorial / mysql

Discussion in 'Ruby' started by lewcio@gmail.com, Oct 26, 2005.

  1. Guest

    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
     
    , Oct 26, 2005
    #1
    1. Advertising

  2. Curt Hibbs Guest

    ------=_Part_2969_21431517.1130334263040
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    On 10/26/05, <> 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



    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 o=
    f
    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

    ------=_Part_2969_21431517.1130334263040--
     
    Curt Hibbs, Oct 26, 2005
    #2
    1. Advertising

  3. Guest

    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!
     
    , Oct 26, 2005
    #3
  4. Curt Hibbs Guest

    ------=_Part_6175_32932622.1130347829023
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    On 10/26/05, <> 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.



    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 tha=
    t
    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

    ------=_Part_6175_32932622.1130347829023--
     
    Curt Hibbs, Oct 26, 2005
    #4
  5. Guest

    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?
     
    , Oct 26, 2005
    #5
  6. Curt Hibbs Guest

    ------=_Part_6347_11494507.1130348996088
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    On 10/26/05, <> 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

    ------=_Part_6347_11494507.1130348996088--
     
    Curt Hibbs, Oct 26, 2005
    #6
  7. Dean Wampler Guest

    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 <> wrote:
    > On 10/26/05, <> 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 meani=

    ng
    > to try it, but haven't yet got around to it.
    >
    > Curt
    >
    >



    --
    Dean Wampler
    http://www.aspectprogramming.com
    http://www.newaspects.com
     
    Dean Wampler, Oct 26, 2005
    #7
  8. Guest

    Right on, it's there.
    Interestingly, I'm set to InstantRails\bin\ruby.exe.
    It works with Curt's method above nevertheless. Thanks guys.
     
    , Oct 26, 2005
    #8
  9. Curt Hibbs Guest

    ------=_Part_7735_2170710.1130355143559
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

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

    On 10/26/05, <> 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.
    >
    >
    >


    ------=_Part_7735_2170710.1130355143559--
     
    Curt Hibbs, Oct 26, 2005
    #9
  10. Guest

    You're right. I mistyped the path.
     
    , Oct 27, 2005
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeremy Jones
    Replies:
    1
    Views:
    283
    Ville Vainio
    Jan 28, 2005
  2. Jeremy Jones

    couple of new python articles on onlamp

    Jeremy Jones, Jun 3, 2005, in forum: Python
    Replies:
    2
    Views:
    290
    George Yoshida
    Jun 4, 2005
  3. Paul McGuire

    "Intro to Pyparsing" Article at ONLamp

    Paul McGuire, Jan 27, 2006, in forum: Python
    Replies:
    10
    Views:
    612
    Peter Hansen
    Jan 30, 2006
  4. Lyle Johnson
    Replies:
    9
    Views:
    124
    Curt Hibbs
    Jan 24, 2005
  5. Replies:
    5
    Views:
    179
    David Vallner
    Feb 13, 2006
Loading...

Share This Page