Undefined method `init' for Mysql:Class on Mac with rvm and Passenger 3

I tried to find some help in the Passenger group without luck. I would
not like to use mysql2 gem (it gives an error too) because in
production I have to use mysql gem anyway. I moved to Passenger 3 and
I am not able to run a Rails 2 and a 3 apps. They both uses Passenger
3 (latest) and ree 2011.03.

The Rails 2 app gives uninitialized constant MysqlCompat::MysqlRes

The Rails 3:

NoMethodError

undefined method `init’ for Mysql:Class

Rails.root: /opt/local/apache2/rails-data/apps
Application Trace | Framework Trace | Full Trace

activerecord (3.0.5) lib/active_record/connection_adapters/
mysql_adapter.rb:30:in mysql_connection' activerecord (3.0.5) lib/active_record/connection_adapters/abstract/ connection_pool.rb:229:insend’
activerecord (3.0.5) lib/active_record/connection_adapters/abstract/
connection_pool.rb:229:in `new_connection’

On Mar 25, 12:10pm, rtacconi [email protected] wrote:

I tried to find some help in the Passenger group without luck. I would
not like to use mysql2 gem (it gives an error too) because in
production I have to use mysql gem anyway. I moved to Passenger 3 and
I am not able to run a Rails 2 and a 3 apps. They both uses Passenger
3 (latest) and ree 2011.03.

When i’ve read about this sort of error before, it usually boils down
to the fact that the native extension in the library didn’t load.
In particular, make sure that it’s compiled for the right architecture
(eg if you only have a 32bit mysql then you’ll probably end up with a
32bit mysql gem extension, which a 64bit passenger instance can’t
use). lipo -detailed_info /path/to/file will tell you the
architectures supported by an executable / library

Fred

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