Lisa Sheridan
2006-Aug-18 18:11 UTC
[Rails] Connecting to multiple databases, mysql win32 gem problem
I am trying to connect to multiple databases, and have setup an abstract class with a call to establish_connection: class TestBase < ActiveRecord::Base self.abstract_class = true end TestBase.establish_connection( :adapter => "mysql", :host => "host", :username => "user", :password => "pass", :database => "db" ) class Table < TestBase ... end I get an error when trying to use the new connection: Mysql::Error: Lost connection to MySQL server during query: So, I installed the mysql win32 gem: gem install mysql and now I get an error on any page, undefined method `each'' for #<Mysql:0x3883f08> Has anyone figured out how to fix this (besides uninstalling the gem)?