有没有人获得MySQL gem 2.8.1。在OSX 10.7上工作?
我已经安装了MySQL 5.5.13 64位并在成功安装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
运行rake命令时 - 让我们说rake db:migrate - 我明白了:
uninitialized constant MysqlCompat::MysqlRes
知道如何解决这个问题吗?
答案 0 :(得分:26)
我一直在努力解决这个问题。以上两个指针都奏效了。这是我做的:
已添加到.zshrc或.bash_profile:
export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
执行此操作:
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
答案 1 :(得分:5)
尝试将此添加到〜/ .bash_profile:
export DYLD_LIBRARY_PATH =“/ usr / local / mysql / lib:$ DYLD_LIBRARY_PATH”
答案 2 :(得分:0)
如果可能的话,降级到MySQL 5.1可能是最简单的路径。