简体   繁体   中英

MySQL gem on OSX 10.7 Lion

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM