本文介绍了安装Ruby gems时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 错误:找不到有效的gem'bundler' (> = 0),原因如下:
无法从https://rubygems.org/下载数据 - Errno :: ETIMEDOUT:
无法打开TCP连接到api.rubygems.org: 443(由于连接方在一段时间后没有正确响应,
或建立的连接失败,因为连接的主机未能响应,因此连接尝试失败
导致
- connect(2)为api.rubygems.org端口443)(https://api.rubygems.org/specs.4。
8.gz)

宝石我试过安装:


  • Nokogiri

  • Mechanize

  • Bundler (显然)



所有产生同样的错误,我猜这是所有的宝石,不只是

我从来没有见过这个,所以我不知道该怎么做,有人能告诉我发生了什么事吗?可能值得一提的是我处于安全的网络中。






更新



我试图在防火墙中初始化一个新的规则,允许我通过端口443使用TCP连接( gem install 运行);然而,我仍然收到错误




更新

我已经做了一些研究,并尝试使用 gem update --system 通过资源。然而,它仍然抛出相同的错误,并且不允许我更新。

解决方案

我不完全确定发生了什么。但是我能够进入另一个网络并下载宝石。



没有代理,没有VPN设置,但有一个默认脚本,所以我猜测这与它有关。



因此,决议是我进入了一个不同的网络,并成功地安装了我所需要的东西。

Whilst installing Ruby gems I'm getting the following error:

ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT:
 Failed to open TCP connection to api.rubygems.org:443 (A connection attempt fai
led because the connected party did not properly respond after a period of time,
 or established connection failed because connected host has failed to respond.
- connect(2) for "api.rubygems.org" port 443) (https://api.rubygems.org/specs.4.
8.gz)

Gems I've attempted to install:

  • Nokogiri
  • Mechanize
  • Bundler (Obviously)

All producing the same error, I'm guessing it's all the gems, not just bundler.

I've never seen this before so I'm not sure what to do, could someone tell me what's going on? It's probably worth mentioning that I am on a secure network.


UPDATE:

I've attempted to initialize a new rule in my firewall that will allow me to use TCP connection through port 443 (the port that gem install runs off of); However I'm still getting the error


UPDATE:

I've done some research and attempted to update using gem update --system via this resource. However it's still throwing the same error, and will not allow me to update

解决方案

I'm not entirely sure what happened. However I was able to get onto another network and download gems.

There was no proxy, there was no VPN setup, but there was a default script so I'm guessing that had something to do with it.

So the resolution was I got onto a different network and successfully installed what I needed

这篇关于安装Ruby gems时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 18:17