uninitialized constant MysqlCompat::MysqlRes

Macbook 466
Mac OS X 10.6.3
Rails 2.3.5
Ruby 1.8.7
MySQL mysql-5.1.45-osx10.6-x86

after install mysql gem with "sudo env ARCHFLAGS="-arch i386" gem
install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
"

use "rake db:migrate"

but always dispay the error msg:

rake aborted!
uninitialized constant MysqlCompat::MysqlRes

what should I do?

rake aborted!
uninitialized constant MysqlCompat::MysqlRes

what should I do?

Few things to check:

- Is the config file location you've given correct?
- Have you checked your mysql logs for errors?
- Looks like you might be using homebrew; I had an issue where I had a
another mysql config file (from a previous installation) /etc/my.cnf
which was being read before the mysql_config file - if so remove the
my.cnf file.
- Are you running the correct version i.e. maybe you need to install the
mysql gem with -arch x86_64 instead.

Cheers
Luke