lion rbenv bundler mysql: uninitialized constant MysqlCompat::MysqlRes

On OSX Lion, when using rbenv and bundler I ran into the following problem when trying to run the rake db tasks:

uninitialized constant MysqlCompat::MysqlRes

This issue also came about when I was using rvm instead of rbenv.

To fix…

Add the following to bash profile:

export ARCHFLAGS="-arch x86_64"

export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

Run the following in terminal:

bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config

bundle install
  1. obiwanchinobi posted this