First thing you'll want to do is confirm you've got the right version of MySQL installed. Run this command and confirm the output is mysql -> mysql-5.1.30-osx10.5-x86
ls -l /usr/local
If you see the x86_64 version you'll need to reinstall MySQL. Backup all your databases first and then install MySQL again. You can download a package for MacOS X 10.4 and 10.5 from their site.
Once you've got the right version of MySQL installed, grabbing the gem is as simple as running
sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config