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.

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


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?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs