Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL gem on OSX 10.7 Lion

Tags:

mysql

macos

gem

Did anyone got the MySQL gem 2.8.1. working on OSX 10.7 ?

I've installed MySQL 5.5.13 64bit and tried the following after the successful installation of MySQL:

env ARCHFLAGS="-arch x86_64" gem install mysql -v='2.8.1' -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config

When running a rake command - let's say rake db:migrate - I get this:

uninitialized constant MysqlCompat::MysqlRes

Any idea how to fix that?

like image 948
sdepold Avatar asked Jun 14 '11 07:06

sdepold


2 Answers

I had been struggling with this issue. The two above pointers worked. Here is what I did:

  1. Added to .zshrc or your .bash_profile:

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

  2. Executed this:

    env ARCHFLAGS="-arch x86_64" sudo gem install mysql -v='2.8.1' -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config

like image 61
Sunil Karkera Avatar answered Nov 18 '22 13:11

Sunil Karkera


Try adding this to your ~/.bash_profile:

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

like image 23
Ilya Sabanin Avatar answered Nov 18 '22 13:11

Ilya Sabanin