After trying to get the mysql gem working on my new macbook in Leopard, I realized that although I can get the gem to compile correctly it still doesn’t work with the mysql 64-bit version. This realization mostly came from searching and finding this useful blog post.
I reinstalled the 32 bit version of mysql and then recompiled the mysql gem. Then magically things started working the way I needed them to. Hopefully this can get fixed in a future version of Ruby.
Here is the command I had to use to finally install the gem properly.
sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config --with-mysql-lib=/usr/local/mysql/lib --with-mysql-dir=/usr/local/mysql --with-mysql-include=/usr/local/mysql/include
Notice the i386 arch. I was previously using x86_64 as the arch which compiled properly and appeared to work until you actually tried to use the gem in ruby and got a stack trace.