在使用gem安装软件包时,会时常遇到下面的问题:html
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ECONNRESET: Connection reset by peer - SSL_connect (xxx)
不少人不知道缘由是什么,有怀疑OpenSSL心跳出血问题的,用怀疑GFW的。linux
其实缘由真的就是GFW的问题。那怎么解决?ruby
只要将原来的源安装网址,更换为更加稳定的就能够了。在国内大淘宝提供了一个镜像,https://ruby.taobao.org/。是官网的所有镜像,并且每15分钟会同步一次,速度及稳定性都有保证。下面是具体的解决步骤:markdown
$ gem source -r https://rubygems.org/
$ gem source -a https://ruby.taobao.org/
$ gem source -l
*** CURRENT SOURCES ***
https://ruby.taobao.org
$
http://www.linuxidc.com/Linux/2015-03/115545.htm
http://www.bubuko.com/infodetail-739997.html
https://ruby.taobao.org/
http://furzoom.com/category/linux/spa
更多请参考Gem管理。code