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

November 11, 2011
brew install mysql

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:

mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp

Install mysql gem:

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

To find out what your machine is. use uname -a

pixelstats trackingpixel

1 Comment. Leave new

Balaji D Loganathan
November 28, 2011 7:24 PM

The simplest option is to go for mysql2 gem.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

%d bloggers like this: