Could not verify the SSL certificate for https://rubygems.<domain_removed>.com/.
There is a chance you are experiencing a man-in-the-middle attack, but most likely your system
doesn't have the CA certificates needed for verification. For information about OpenSSL
certificates, see bit.ly/ruby-ssl. To connect without using SSL, edit your Gemfile sources and
change 'https' to 'http'.
在尝试捆绑使用 2.0 之前版本的 Rails 的现有 Rails 应用程序时,我遇到了上述错误。当我在目录中执行 ruby --version
时,我得到:
ruby 1.9.3p545(2014-02-24 修订版 45159)[x86_64-darwin14.1.0]
我昨晚使用 RVM 安装 ruby-2.2.3
,它似乎干扰了我的证书。我该如何撤销或解决问题?
➜ homedev rvm install ruby-2.2.3
Warning, new version of rvm available '1.26.11', you are using older version '1.26.10'.
You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/osx/10.10/x86_64/ruby-2.2.3.tar.bz2
Checking requirements for osx.
Updating certificates in '/usr/local/etc/openssl/cert.pem'.
Requirements installation successful.
ruby-2.2.3 - #configure
ruby-2.2.3 - #download
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6338k 100 6338k 0 0 250k 0 0:00:25 0:00:25 --:--:-- 334k
No checksum for downloaded archive, recording checksum in user configuration.
ruby-2.2.3 - #validate archive
ruby-2.2.3 - #extract
ruby-2.2.3 - #validate binary
ruby-2.2.3 - #setup
ruby-2.2.3 - #gemset created /Users/stevebissett/.rvm/gems/ruby-2.2.3@global
ruby-2.2.3 - #importing gemset /Users/stevebissett/.rvm/gemsets/global.gems.......................-
ruby-2.2.3 - #generating global wrappers........
ruby-2.2.3 - #gemset created /Users/stevebissett/.rvm/gems/ruby-2.2.3
ruby-2.2.3 - #importing gemsetfile /Users/stevebissett/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.3 - #generating default wrappers........
Updating certificates in '/etc/openssl/cert.pem'.
最佳答案
我遇到了类似的 SSL 验证问题。在我的例子中,我得到了一个类似于
的错误~/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
默认的 RVM 二进制文件可能链接到一个 OpenSSL 路径,该路径不是您系统中配置的路径。
我建议您删除 Ruby 2.2.3 并重新安装它,在您的计算机上编译二进制文件,以便链接正确的 OpenSSL 版本。
rvm remove 2.2.3
rvm install 2.2.3 --disable-binary
关于ruby-on-rails - 安装 Ruby 2.2.3 后捆绑 SSL 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34309289/