I just had the following problem when trying to start a Ruby on Rails application on a fresh installation of Mac OS X Snow Leopard after I installed the mysql gem via gem install mysql:

uninitialized constant MysqlCompat::MysqlRes

I searched a bit and found a solution here. It was a problem with a buggy version of  the Mysql driver. So you need to use a different version when installing the mysql gem. So first uninstall the existing gem via

gem uninstall mysql

and reinstall it via

export ARCHFLAGS="-arch i386 -arch x86_64" ;sudo gem install --no-rdoc --no-ri  -v=2.7 mysql -- --with-mysql-dir=/usr/local/mysql  --with-mysql-config=/usr/local/mysql/bin/mysql_config