The Satyavolu Family Website

Installing MySQL gem on Mac OS X Leopard

Installing the MySQL gem on Leopard was much more painful than I thought. I had the 64-bit version of MySQL already installed. So I had to uninstall MySQL on Leopard, which was a challenge all on its own. Here is what I did (after stopping MySQL, and backing up my databases first, of course):

sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MySQLCOM
sudo rm -rf /Library/PreferencePanes/My*
sudo rm -rf /Library/Receipts/mysql*
sudo rm -rf /Library/Receipts/MySQL*
vi /etc/hostconfig # remove the line MYSQLCOM=-YES-

Then I had to install the 32-bit version of MySQL for Mac OS X. After that is installed, I had to use the following to get the gem to compile:

sudo env ARCHFLAGS="-arch i386" gem install mysql -- \
--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \
--with-mysql-include=/usr/local/mysql/include

Reply