简体   繁体   中英

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

Problem: after gem sources -a https://rubygems.org/

Error shown:

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

Background: Looking to learn some RoR, I installed Ubuntu 14.04, and then followed 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 SSL Error When installing rubygems, Unable to pull data from 'https://rubygems.org/ to change the gem source to http://rubygems.org/

However, I was unable to change the gem source back to https://rubygems.org/ even after gems update --system and gems update (In the meantime, I completed the installation of RoR by attempting to rails new myApp and installing the missing gem every time bundle install failed, which took a very long time).

Suspecting the openssl to be the culprit, I tried to download the latest openssl certificate (1.0.2d) directly and followed another tutorial to install it. However, the tutorial didn't mention specifically where to install it to, and so openssl version remained at 1.0.1f 6 Jan 2014 . Following this I tried 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 , purged openssl and re-installed the original openssl that came with the os by apt-get install openssl , having read from somewhere else that this shouldn't be a problem. https://askubuntu.com/questions/449184/how-to-upgrade-openssl-1-0-1f-on-ubuntu-server-14-04

Unfortunately, http://railsapps.github.io/openssl-certificate-verify-failed.html also failed to solve the problem, since I'm using ubuntu instead of OSX, and rbenv instead of rvm (indeed it specifically states that versions newer than Ubuntu 12.04 should not have the problem, and I don't know what to do with the openssl 1.0.1-4ubuntu5 package it suggested as a fix.

Install rvm first.Then execute the following commands: 1.gem update --system 2.rvm osx-ssl-certs update all

First command will fetch the updates . Second will update the ssl certificates

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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