2013-10-07 32 views
15

我試過gem install幾乎所有的寶石,我一直在收到錯誤。我想我需要重置或更新計算機上的某些內容,但不知道是什麼。爲什麼我無法在我的Mac上安裝任何寶石?

下面是一些命令行代碼的錯誤:

ERROR: Could not find a valid gem 'multi_json' (>= 0), here is why: 
      Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz) 

ERROR: Could not find a valid gem 'cowsay' (>= 0), here is why: 
      Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz) 

sudo gem install rubygems-update 
Password: 
ERROR: Could not find a valid gem 'rubygems-update' (>= 0), here is why: 
      Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz) 

有誰知道我需要做的解決這一問題?我有一臺新電腦,想知道是否需要設置不同的用戶?

+0

+1因爲我看到的寶石無數Github的問題報告沒有人意識到它無關與寶石而是服務器推動寶石。 – kobaltz

回答

49

我有同樣的問題,並從上述用戶的工作對我來說這個解決方案。

rvm osx-ssl-certs update all 
+0

你對rbenv有答案嗎? (仍然給你upvote) – kubbing

9

最近似乎有這個共同的問題。如果你是一個Mac上,嘗試做這個,如果你通過RVM安裝:

rvm osx-ssl-certs update all 
5

對於那些使用的arent RVM,但使用的是自制的:

brew tap raggi/ale 
brew install openssl-osx-ca 

這爲我工作。

6

或者你可以用下面的命令添加不安全紅寶石源:

sudo gem sources -a http://rubygems.org