开发者

MySQL gem on OSX 10.7 Lion

开发者 https://www.devze.com 2023-03-13 00:24 出处:网络
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:

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-incl开发者_运维百科ude=/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?


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


Try adding this to your ~/.bash_profile:

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


Downgrading to MySQL 5.1 is probably the easiest route, if possible.

0

精彩评论

暂无评论...
验证码 换一张
取 消