MySQL connection issue...

Discussion in 'Ruby' started by Harnish Botadra, Oct 18, 2007.

  1. Hey All,

    I am getting the following error in my Ruby Script:

    --------------------------
    mysql_adapter.rb:322:in `connect': undefined method `[]' for
    nil:NilClass (NoMethodError)
    --------------------------

    Essentially it occurs at a point when the script tries to connect to the
    MySQL DB.

    Sample code:

    ---------------
    class Test < ActiveRecord::Base
    def self.foo
    end
    end

    Test.transaction do # => Point of error
    Test.foo # => Another point of error occu...
    end
    ---------------

    Any help greatly appreciated. Thanks.

    ---Harnish
    --
    Posted via http://www.ruby-forum.com/.
     
    Harnish Botadra, Oct 18, 2007
    #1
    1. Advertising

  2. Harnish Botadra

    Phil Guest


    > -----Original Message-----
    > From: [mailto:] On
    > Behalf Of Harnish Botadra
    > Sent: Donnerstag, 18. Oktober 2007 09:19
    > To: ruby-talk ML
    > Subject: MySQL connection issue...
    >
    > Hey All,
    >
    > I am getting the following error in my Ruby Script:
    >
    > --------------------------
    > mysql_adapter.rb:322:in `connect': undefined method `[]' for
    > nil:NilClass (NoMethodError)
    > --------------------------
    >
    > Essentially it occurs at a point when the script tries to connect to
    > the
    > MySQL DB.


    Is the mysql gem installed?

    --
    Phill
     
    Phil, Oct 18, 2007
    #2
    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. JL
    Replies:
    0
    Views:
    1,174
  2. Ravi
    Replies:
    6
    Views:
    1,433
    Suchandra Thapa
    Jul 21, 2003
  3. Replies:
    2
    Views:
    6,236
  4. johnny
    Replies:
    1
    Views:
    811
    Jerry Hill
    Dec 8, 2006
  5. washakie
    Replies:
    4
    Views:
    949
    washakie
    Jan 15, 2008
Loading...

Share This Page