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 的问题。

目录
相关文章
|
5月前
|
Python
pip安装包报错Could not find a version that satisfies the requirement pymysql (from versions: none)
pip安装包报错Could not find a version that satisfies the requirement pymysql (from versions: none)
243 1
|
5月前
|
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.
65 0
|
11月前
|
Python
解决"easy_install command not found"问题记录
解决"easy_install command not found"问题记录
435 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]
277 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重新设置
1063 0
npm install报错error 404 Not Found - GET https://registry.npm.taobao.org/@xt
|
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? 错误
643 0
|
Ruby
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.错误解决办法
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /usr/bin directory.错误解决办法
2500 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
270 0
yum install 命令报错Could not retrieve mirrorlist

热门文章

最新文章