2016-09-26 180 views
2

我想为我的一个rails项目安装mysql2 gem,但出现错误。当我运行无法在MacOS上安装“mysql gem”Sierra

ld: library not found for -lssl 

但是:

brew install openssl 

我得到(这证明我有-lssl库):我运行此命令:

gem install mysql2 

错误说

Error: openssl-1.0.2f already installed 
To install this version, first `brew unlink openssl` 

另外,当我运行(这证明我有mysql我的机器上):

brew install mysql 

我得到:

Error: mysql-5.7.10 already installed 
To install this version, first `brew unlink mysql` 

很失落,很想解决这个问题,谢谢提前。我正在运行brew版本1.0.4。

+1

尝试'酿造doctor'? –

+0

@BradJohnson谢谢,我可以从'brew doctor'得到一些提示,但不是完整的解决方案。请参阅下面的答案。 –

+0

引用此:http://stackoverflow.com/questions/39617761/cant-install-mysql2-gem-on-macos-sierra –

回答

0

我解决了同样的问题在我的MacOS塞拉利昂通过刷新宝石参考:

gem source -r https://rubygems.org/ 
gem source -a https://rubygems.org/