ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)

简介: 原文地址:https://www.zfanw.com/blog/error-while-executing-gem-gem-remote-fetch-error.html 我对命令行下安装 gem 包或是 npm 包有很大的心理阴影,因为出现无法​安装的概率实在太大了 – 每次都要破口大骂 gfw。

原文地址:https://www.zfanw.com/blog/error-while-executing-gem-gem-remote-fetch-error.html

我对命令行下安装 gem 包或是 npm 包有很大的心理阴影,因为出现无法​安装的概率实在太大了 – 每次都要破口大骂 gfw。

这一回是在更新 gem 时:

gem update --system

返回的错误如下:

ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)

Errno::ETIMEDOUT: Operation timed out – connect(2) for “s3.amazonaws.com” port 443 (https://api.rubygems.org/specs.4.8.gz)

出现 s3 的地址是因为此前 https://rubygems.org 源地址不行,所以执行了 gem source 添加源库:

gem source --add https://s3.amazonaws.com/production.s3.rubygems.org/

如你所见,还是报错。

查了资料,不巧 StackOverflow 上这个问题提到了 Proxy,我国的国情,不挂代理简直混不下去 IT 业,所以我的 Mac OSX 的代理环境是这样的:

privoxy(http://localhost:8118) -> sslEdge(http://localhost:100010)全局 

Privoxy 我是用来去除一些广告。且把死马当活马医吧:

export http_proxy=http://localhost:8118
export https_proxy=http://localhost:8118 
gem update --system

然后目瞪口呆:

Updating rubygems-update
Fetching: rubygems-update-2.4.7.gem (100%) Successfully installed rubygems-update-2.4.7 Parsing documentation for rubygems-update-2.4.7 Installing ri documentation for rubygems-update-2.4.7 Installing darkfish documentation for rubygems-update-2.4.7 Done installing documentation for rubygems-update after 2 seconds Installing RubyGems 2.4.7 RubyGems 2.4.7 installed Parsing documentation for rubygems-2.4.7 Installing ri documentation for rubygems-2.4.7 

竟然真是代理的问题。所以我猜想是 iterm2 不支持 socks 代理,因此全局并未生效。而通过 Privoxy 的 HTTP 代理做一次转发,就正常了 – 所以,还是 gfw 的问题。

目录
相关文章
|
3月前
|
数据安全/隐私保护 iOS开发 MacOS
Mac终端出现 brew command not found 解决
Mac终端出现 brew command not found 解决
104 3
|
5月前
已解决E: dpkg was interrupted, you must manually run ‘sudo dpkg --configure -a‘ to correct the problem.
已解决E: dpkg was interrupted, you must manually run ‘sudo dpkg --configure -a‘ to correct the problem.
53 0
|
Ruby
解决安装bundler提示ERROR: Error installing bundler:bundler requires Ruby version >= 2.3.0.
解决安装bundler提示ERROR: Error installing bundler:bundler requires Ruby version >= 2.3.0.
216 0
|
Ubuntu 开发工具 git
apt install git:Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/g/git/git-man_2.17.1-1ubuntu0.11_all.deb 404 Not Found [IP: 91.189.91.39 80]
350 0
apt install git:Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
|
JavaScript
npm install报错error 404 Not Found - GET https://registry.npm.taobao.org/@xt
1.问题场景: 2.解决办法 2.1先查看有没有设置代理 2.2重新设置
1194 0
npm install报错error 404 Not Found - GET https://registry.npm.taobao.org/@xt
如何解决使用npm install 时报错:npm ERR! { Error: EPERM: operation not permitted, mkdir..
如何解决使用npm install 时报错:npm ERR! { Error: EPERM: operation not permitted, mkdir..
如何解决使用npm install 时报错:npm ERR! { Error: EPERM: operation not permitted, mkdir..
|
Ubuntu 网络安全 开发工具
Ubuntu E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 错误
Ubuntu E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing? 错误
855 0
|
关系型数据库 MySQL
You can remove cached packages by executing ‘yum clean packages‘. Error: GPG check FAILED
我们在使用服务器时安装mysql遇到的问题,现将有效的解决方案列出来 原因是:GPG对于包的源key的验证没有通过
You can remove cached packages by executing ‘yum clean packages‘. Error: GPG check FAILED
yum install 命令报错Could not retrieve mirrorlist
yum install 命令报错Could not retrieve mirrorlist
367 0
yum install 命令报错Could not retrieve mirrorlist