[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

MySQL connection issue...

Harnish Botadra

10/18/2007 8:19:00 AM

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

1 Answer

Phillip Gawlowski

10/18/2007 9:02:00 AM

0



> -----Original Message-----
> From: list-bounce@example.com [mailto:list-bounce@example.com] 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