我正在尝试使用来安装 gem。当我执行命令时,我会收到以下响应:
ERROR: Could not find a valid gem 'bundler' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://api.rubygems.org/latest_specs.4.8.gz)
ERROR: Possible alternatives: bundler为了确保我没有发疯,我试着安装nokogiri:
ERROR: Could not find a valid gem 'nokogiri' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://api.rubygems.org/latest_specs.4.8.gz)
ERROR: Possible alternatives: nokogiri和a2z:
ERROR: Could not find a valid gem 'a2z' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ETIMEDOUT: Operation timed out - connect(2) (https://api.rubygems.org/quick/Marshal.4.8/a2z-0.1.3.gemspec.rz)如果有人以前有过这方面的经验,并能帮助我,我们将不胜感激。
如果有帮助的话,我将运行MacOS Mavericks,并拥有gem版本2.2.2。
发布于 2014-08-18 15:43:43
在您的Gemfile中设置
source 'http://production.s3.rubygems.org'
这也许不是一个正式的答案,但在尝试访问rubygems.org的三天后,它对我起了作用。
发布于 2019-09-17 23:45:20
太晚了,但我解决了这个问题,禁用了我的系统操作系统中的IPv6连接。它强制操作系统只使用IPv4,然后就可以工作了。
发布于 2021-01-27 21:14:38
对于使用Windows的人,以下内容在Windows 10上对我起作用。也请参见红宝石问题列表上的我的回复。
https://stackoverflow.com/questions/23659119
复制相似问题