首页 > 解决方案 > SSL证书错误通过rvm安装ruby

问题描述

我正在尝试使用 rvm 安装 ruby​​,我得到以下与 SSL 证书错误相关的输出:

rvm install 2.6.3

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/11.2/x86_64/ruby-2.6.3.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/user/.rvm/rubies/ruby-2.6.3, this may take a while depending on your cpu(s)...
ruby-2.6.3 - #downloading ruby-2.6.3, this may take a while depending on your connection...
ruby-2.6.3 - #extracting ruby-2.6.3 to /Users/user/.rvm/src/ruby-2.6.3 - please wait
ruby-2.6.3 - #configuring - please wait
ruby-2.6.3 - #post-configuration - please wait
ruby-2.6.3 - #compiling - please wait
ruby-2.6.3 - #installing - please wait
ruby-2.6.3 - #making binaries executable - please wait
curl: (60) SSL: no alternative certificate subject name matches target host name 'rubygems.org'
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
There was an error while trying to resolve rubygems version for 'latest'. 
Halting the installation.

如果有人知道如何解决此错误,我们将不胜感激。谢谢!

标签: rubyssl

解决方案


  1. 似乎您与 ruby​​gems.org 的连接有问题,请确保您有良好的互联网连接,以便可以下载安装所需的文件。

  2. 忘记 RVM,改用 rbenv。

  3. 如果仍然遇到这种问题(从 ruby​​gems.org 或 ruby​​-lang.org 下载时与 ssl cert 相关),请尝试选择 rvm/rbenv 的新镜像。例如,中国人在taobao安装时可能会选择镜像: git clone https://github.com/andorchen/rbenv-taobao-mirror.git ~/.rbenv/plugins/rbenv-taobao-mirror


推荐阅读