Just a quick note. I lost an hour to fiddling about with this.
If you’re having trouble with the mysql gem version 2.8.1 on OSX 10.6 try uninstalling it and building it this way:
sudo gem uninstall mysql
export ARCHFLAGS="-arch i386 -arch x86_64" ; gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config
The gem should build with no errors or warnings. The paths to mysql-dir and mysql-config are standard paths used by the mysql dmg, you might want to check your own paths first with: