The trick is that the library install path isn’t right in the gem bundle.
The following commands fixed it for me:
$ cd /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/lib
$ sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib mysql_api.bundle
$ cd /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext
mysql_api/
$ sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib mysql_api.bundle
The install name is set to the absolute path of the library that the bundle links to.
Original source for the fix is here:
http://lightyearsoftware.com/2011/02/mysql-5-5-on-mac-os-x/