如何解决Ruby,Windows平台上的“ gem install Blunder”错误
我正在尝试安装Blunder。
gem install Blunder
但是我遇到了这个错误
ERROR: Could not find a valid gem 'bundler' (>= 0),here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (https://rubygems.org/specs.4.8.gz)
我尝试通过此网址(Error installing Bundler)进行修复,但注意到已解决。
更多详细信息:
我可以访问“ https://rubygems.org/”网址。 (不使用任何代理。)
我可以下载“ https://rubygems.org/specs.4.8.gz”
我通过某些VPN连接进行连接,但是出现了相同的错误。
我测试了update命令。但我遇到了这个错误
gem install rubygems-update
C:\Windows\System32>gem update --system
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (https://rubygems.org/specs.4.8.gz)
我测试了其他一些gem安装命令,例如
gem update --system
gem install installer
C:\Windows\System32>gem install installer
ERROR: Could not find a valid gem 'installer' (>= 0),here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (https://rubygems.org/specs.4.8.gz)
C:\Windows\System32> gem install rubygems-update
ERROR: Could not find a valid gem 'rubygems-update' (>= 0),here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (https://rubygems.org/specs.4.8.gz)
“宝石来源-a http://rubygems.org”命令的结果。
C:\WINDOWS\system32>gem sources -a http://rubygems.org
https://rubygems.org is recommended for security over http://rubygems.org
Do you want to add this insecure source? [yn] y
http://rubygems.org is too similar to https://rubygems.org
Do you want to add this source? [yn] y
Error fetching http://rubygems.org:
Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (http://rubygems.org/specs.4.8.gz)
“宝石来源-r https://rubygems.org -a http://rubygems.org”命令的结果。
C:\WINDOWS\system32>gem sources -r https://rubygems.org -a http://rubygems.org
https://rubygems.org is recommended for security over http://rubygems.org
Do you want to add this insecure source? [yn]
https://rubygems.org is recommended for security over http://rubygems.org
Do you want to add this insecure source? [yn] y
http://rubygems.org is too similar to https://rubygems.org
Do you want to add this source? [yn] y
Error fetching http://rubygems.org:
Errno::ECONNREFUSED: Failed to open TCP connection to 127.0.0.1:1080 (No connection could be made because the target machine actively refused it. - connect(2) for "127.0.0.1" port 1080) (http://rubygems.org/specs.4.8.gz)
我安装了Ruby 2.7.1-1-x64的最新版本 安装后,我运行了“ ridk install”以设置MSY2 .....,但我看到一个错误
gpg: refreshing 8 keys from hkps://hkps.pool.sks-keyservers.net
gpg: keyserver refresh failed: General error
==> ERROR: A specified local key could not be updated from a keyserver.
此外,在“ C:\ Ruby26-x64 \ lib \ ruby \ 2.6.0 \ win32 \ registry.rb”文件中。我从以下位置设置本地编码
LOCALE = Encoding.find(Encoding.locale_charmap)
到
LOCALE =编码:: UTF_8
感谢您的帮助。
解决方法
我在Internet Explorer的“配置代理服务器”中将代理设置为127.0.0.1:1080。
然后,我使用了诸如Ultra-surfe之类的代理应用程序,并将其端口设置为1080。最后"gem install bundler"
命令起作用了。
现在,我的问题是:为什么Ruby尝试从代理端口连接到其服务器?? 我通过此代码从命令行检查了代理
netsh winhttp show proxy
我也重置了代理
netsh winhttp show proxy
但是Ruby“ gem installation”的命令仍然寻找通过127.0.0.1:1080打开TCP连接。为什么???我的系统有问题吗?
我确定这对我的系统来说不是问题,因为"npm install ..."
命令可以正常工作。例如该命令
npm install touch-cli -g
我将搜索此问题,也许以后我会在新帖子中提出新问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。