即使在 ubuntu 14.04 gem 更新系统后,也无法从 https://rubygems.org/ 获取数据

Unable to get data from https://rubygems.org/ even after gem update system on ubuntu 14.04

问题: 在 gem sources -a https://rubygems.org/

之后

显示错误:

Error fetching https://rubygems.org/: 
Errno::ECONNRESET: Connection reset by peer - SSL_connect
(https://api.rubygems.org/specs.4.8.gz)

背景: 为了学习一些 RoR,我安装了 Ubuntu 14.04,然后安装了 https://gorails.com/setup/ubuntu/14.04 to install RoR. I ran into problems with bundle install due to https://rubygems.org/ not working, so I took the advice from bundle install fails with SSL certificate verification error and to change the gem source to http://rubygems.org/

但是,即使在 gems update --systemgems update 之后,我也无法将 gem 源更改回 https://rubygems.org/ (与此同时,我通过尝试 rails new myApp 并在每次 bundle install 失败时安装缺少的 gem 来完成 RoR 的安装,这花费了很长时间)。

怀疑openssl是罪魁祸首,我尝试直接下载最新的openssl证书(1.0.2d)并按照另一个教程进行安装。但是教程并没有具体说明安装到哪里,所以openssl version还是1.0.1f 6 Jan 2014。在此之后,我尝试了 https://superuser.com/questions/740930/apt-get-upgrade-openssl-wont-bring-ubuntu-12-04-to-latest-version and https://askubuntu.com/questions/429385/upgrade-openssl-on-ubuntu-12-04,清除了 openssl 并重新安装了 apt-get install openssl os 附带的原始 openssl,从其他地方读到这应该不是问题。 https://askubuntu.com/questions/449184/how-to-upgrade-openssl-1-0-1f-on-ubuntu-server-14-04

不幸的是,http://railsapps.github.io/openssl-certificate-verify-failed.html 也未能解决问题,因为我使用 ubuntu 而不是 OSX,并且 rbenv 而不是 rvm(实际上它明确指出版本较新比 Ubuntu 12.04 应该没有问题,我不知道如何处理它建议作为修复的 openssl 1.0.1-4ubuntu5 包。

安装rvm first.Then执行以下命令: 1.gem更新--系统 2.rvm osx-ssl-certs 全部更新

第一个命令将获取更新。 其次将更新 ssl 证书