在rvm错误上安装ruby

时间:2011-09-13 03:00:46

标签: ruby-on-rails rubygems rvm

我正在按照rvm指南在OSX Leopard上安装: http://beginrescueend.com/rvm/install/

我必须努力工作直到必须离开 rvm install 1.9.2

然而,当我运行该命令时,我开始收到错误:

summer$ rvm install 1.9.2-p290
Installing Ruby from source to: /Users/summer/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...

ruby-1.9.2-p290 - #fetching 
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
ERROR: There was an error, please check /Users/summer/.rvm/log/ruby-1.9.2-p290/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
ERROR: There was an error, please check /Users/summer/.rvm/log/ruby-1.9.2-p290/*.log
ERROR: There has been an error while trying to fetch the source.  
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.

更新:关于Deryls响应:

修改后出现

错误:

rvm install 1.9.2
Installing Ruby from source to: /Users/summer/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...

ruby-1.9.2-p290 - #fetching 
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
curl: option -: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
ERROR: There was an error, please check /Users/summer/.rvm/log/ruby-1.9.2-p290/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.
curl: option -: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
ERROR: There was an error, please check /Users/summer/.rvm/log/ruby-1.9.2-p290/*.log
ERROR: There has been an error while trying to fetch the source.  
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.

更新:

我删除了 - 最后得到了:

rvm install 1.9.2
Installing Ruby from source to: /Users/summer/.rvm/rubies/ruby-1.9.2-p290, this may take a while depending on your cpu(s)...

ruby-1.9.2-p290 - #fetching 
ruby-1.9.2-p290 - #downloading ruby-1.9.2-p290, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
ERROR: There was an error, please check /Users/summer/.rvm/log/ruby-1.9.2-p290/*.log. Next we'll try to fetch via http.
Trying http:// URL instead.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
ERROR: There was an error, please check /Users/summer/.rvm/log/ruby-1.9.2-p290/*.log
ERROR: There has been an error while trying to fetch the source.  
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.

我也试过使用 - (或不使用)最后使用--insecure而不是k的变体,我得到类似的错误。

3 个答案:

答案 0 :(得分:3)

您可以通过更新ca-bundle.crt文件来修复问题的根本原因,而不是修改rvm脚本。在某些Linux发行版上,ca-bundle.crt文件过于陈旧,因此不知道如何处理Github的SSL证书。

您可以做的是在系统上找到ca-bundle.crt,然后从curl.haxx.se下载并重命名cacert.pem为ca-bundle.crt。现在RVM安装程序脚本应该可以正常工作。

这就是我所做的:

cp /etc/pki/tls/certs/ca-bundle.crt ~/ca-bundle.crt.old

sudo curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-b
undle.crt

此机器是EC2实例,运行CentOS 5并使用Rightscale进行管理。 ca-bundle.crt在你的系统上的位置可能会有所不同,但谷歌搜索不会解决一些问题。

答案 1 :(得分:1)

Leopard上的curl版本已经过时。按照beijingyoung在此处列出的步骤操作:https://github.com/mxcl/homebrew/issues/6103#issuecomment-1694558

答案 2 :(得分:1)

您也可以在第61行手动修改$ rvm_path / scripts / fetch

fetch_command="curl -f -L --create-dirs -C - " # -s for silent

并将其更改为

fetch_command="curl -f -L --create-dirs -C -k - " # -s for silent

这样做是告诉curl不关心任何无效的证书(你没有使用你已经注册的CA签名的证书吗?)你也可以添加-s(如#remark所示)以便保持安静。请记住,下次您

时,您可能需要再次进行此更改
rvm get head

更新机器的RVM安装。如果检测到的平台是Leopard,我将向Wayne提出将其作为永久选项的故事,但我不相信这会进入应用程序,因为它会为许多用户带来安全问题。 (他们更愿意看到错误并知道证书存在问题。)