由于国内网络原因(你懂的),导致 rubygems.org 存放在 Amazon S3 上面的资源文件间歇性连接失败,我是在执行
gem install bundler --no-ri --no-rdoc命令的时候发现
[root@carson ~]# gem install bundler --no-ri --no-rdoc ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError) Errno::ECONNREFUSED: Failed to open TCP connection to rubygems.global.ssl.fastly.net:443 (Connection refused - connect(2) for "rubygems.global.ssl.fastly.net" port 443) (https://api.rubygems.org/quick/Marshal.4.8/bundler-1.12.5.gemspec.rz)链接rubygems.global.ssl.fastly.net失败的情况
解决方法:换成淘宝的镜像
$ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/ $ gem sources -l *** CURRENT SOURCES *** https://ruby.taobao.org # 请确保只有 ruby.taobao.orgrubygem淘宝镜像地址: https://ruby.taobao.org/
PS. 换账号之后就不还要重新设置
解决gem连接失败的问题
最新推荐文章于 2024-07-05 16:08:14 发布