繁体   English   中英

在RVM上安装Ruby错误

[英]Installing ruby on rvm error

我正在按照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最后使用-(或不使用)的两种变体,我得到了类似的错误。

您可以通过更新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在系统上的位置可能会有所不同,但是谷歌搜索无法解决的只有几件事。

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

您也可以在第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(如#注释所示),以使其安静。 请记住,下次您可能必须再次进行此更改

rvm get head

更新计算机的RVM安装。 我将向Wayne讲述如果检测到的平台是Leopard,则将其添加为永久选项,但是我认为这不会进入应用程序,因为它为许多用户带来了安全隐患。 (他们更愿意看到错误并知道证书存在问题。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM