2017-05-15 91 views
9

在新的,新的CentOS 7.0 VM Rbenv安裝不會爲我安裝紅寶石如何修復錯誤:無法下載的rbenv安裝

[[email protected] ~]$ rbenv install 2.2.4 
Downloading ruby-2.2.4.tar.bz2... 
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2 
error: failed to download ruby-2.2.4.tar.bz2 

BUILD FAILED (CentOS Linux 7 using ruby-build 20170405-4-g365dd1f) 

有了更詳細的登錄電子就說明

[[email protected] ~]$ rbenv install 2.2.4 -v 
/tmp/ruby-build.20170515092651.20803 ~ 
Downloading ruby-2.2.4.tar.bz2... 
-> https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2 
curl: (35) Peer reports incompatible or unsupported protocol version. 
error: failed to download ruby-2.2.4.tar.bz2 

BUILD FAILED (CentOS Linux 7 using ruby-build 20170405-4-g365dd1f) 

的問題似乎起源於捲曲它看起來像例如

[[email protected] ~]$ curl https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2 
curl: (35) Peer reports incompatible or unsupported protocol version. 
[[email protected] ~]$ curl https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2 -v 
* About to connect() to cache.ruby-lang.org port 443 (#0) 
* Trying 151.101.36.233... 
* Connected to cache.ruby-lang.org (151.101.36.233) port 443 (#0) 
* Initializing NSS with certpath: sql:/etc/pki/nssdb 
* CAfile: /etc/pki/tls/certs/ca-bundle.crt 
    CApath: none 
* NSS error -12190 (SSL_ERROR_PROTOCOL_VERSION_ALERT) 
* Peer reports incompatible or unsupported protocol version. 
* Closing connection 0 
curl: (35) Peer reports incompatible or unsupported protocol version. 
[[email protected] ~]$ 

回答

10

原因你失敗:

某些舊的/易受攻擊的NSS用於cURL庫中的SSL,因此當您轉到某個url時,它會被拒絕。所以在這臺機器中,你有機會不能運行cURL相關的命令,比如pycurl。

解決辦法:

IMO的NSS是捆綁在CentOS 7.0虛擬機,這樣你就可以更新NSS庫如下。

yum update nss nss-util nspr

希望這有助於!

3

在我的情況下更新curl結合nss更新幫助。