Ruby Tips 11: Install mysql gem on Mac OS X Lion

[source]brew install mysql[/source]
Is you have installed mysql server already and have a failed mysql gem, then remove the mysql server first [ see]

Do this to install mysql system tables:
[source]
mysql_install_db –verbose –user=whoami –basedir=”$(brew –prefix mysql)” –datadir=/usr/local/var/mysql –tmpdir=/tmp
[/source]
Install mysql gem:
[source]
sudo env ARCHFLAGS=”-arch x86_64″ gem install mysql — –with-mysql-dir=/usr/local/Cellar/mysql –with-mysql-lib=/usr/local/Cellar/mysql/5.5.15/lib/ –with-mysql-include=/usr/local/mysql/5.5.15/include –with-mysql-config=/usr/local/Cellar/mysql/5.5.15/bin/mysql_config
[/source]
To find out what your machine is. use uname -a

Related Posts

Comments (1)

The simplest option is to go for mysql2 gem.

Leave a comment