2016-09-26 181 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/