“在任何存储库中找不到有效的gem” (红宝石和其他) [英] "Could not find a valid gem in any repository" (rubygame and others)
问题描述
我一直在尝试安装这个'rubygame'gem,但是每当我使用命令时,我都会使用它。
I've been trying to install this 'rubygame' gem for some time, but whenever I use the command
gem install rubygame
它会给出错误:
it will give an error:
ERROR: Could not find a valid gem 'rubygame' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: Connection timed out - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
我也尝试了其他宝石,但结果类似:
I've also tried other gems but with similar results:
ERROR: Could not find a valid gem 'rake' (>= 0) in any repository
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: Connection timed out - connect(2) (http://rubygems.org/latest_specs.4.8.gz)
我已经确认我有互联网连接,并且已经尝试重新安装ruby和rubygems(目前使用红宝石1.8,rubygems 1.7.2)。谷歌搜索没有帮助我。如果有人能解决我的问题,我将非常感激。我的来源列表只显示 http://rubygems.org
I've already made sure I have an internet connection, and have already tried reinstalling both ruby and rubygems (currently using ruby 1.8, rubygems 1.7.2). Googling didn't help me at all. I would be very grateful if anyone can solve my problem. My sources list only shows http://rubygems.org
推荐答案
检查您是否有 https://rubygems.org/ 作为寻找宝石的来源:
Check if you have "https://rubygems.org/" as a source to find gems at:
$ gem sources
*** CURRENT SOURCES ***
https://rubygems.org/
如果不是,您应该可以将其添加到
If not, you should be able to add it with
$ gem sources --add https://rubygems.org/
https://rubygems.org/ added to sources
这里是 gem source
命令的文档。
这篇关于“在任何存储库中找不到有效的gem” (红宝石和其他)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!