First get and install the 64-bit MySQL version:

http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.35-osx10.5-x86_64.dmg/from/pick#mirrors

Then install the MySQL gem as follows:

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config