无法更新 RubyGems
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1954206/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't update RubyGems
提问by o01
I'm having difficulties updating RubyGems from version 1.1.1 to newest. I've tried the following:
我在将 RubyGems 从 1.1.1 版更新到最新版本时遇到了困难。我尝试了以下方法:
gem update
宝石更新
Result:
结果:
Updating installed gems
Bulk updating Gem source index for: http://gems.rubyforge.org/
Nothing to update
更新已安装的 gems
批量更新 Gem 源索引:http: //gems.rubyforge.org/
无需更新
and
和
gem install rubygems-update
宝石安装 rubygems-更新
Result:
结果:
Bulk updating Gem source index for: http://gems.rubyforge.org/
Bulk updating Gem source index for: http://gems.rubyforge.org/
ERROR: Error installing rubygems-update:
rubygems-update requires builder (>= 0)
批量更新 Gem 源索引:http: //gems.rubyforge.org/
批量更新 Gem 源索引:http
://gems.rubyforge.org/ 错误:安装 rubygems-update 时出错:
rubygems-update 需要构建器 (>= 0)
and
和
gem install rubygems-update update_rubygems
gem 安装 rubygems-更新 update_rubygems
Result:
结果:
Bulk updating Gem source index for: http://gems.rubyforge.org/
Bulk updating Gem source index for: http://gems.rubyforge.org/
ERROR: Error installing rubygems-update:
rubygems-update requires builder (>= 0)
ERROR: could not find update_rubygems locally or in a repository
批量更新 Gem 源索引:http: //gems.rubyforge.org/
批量更新 Gem 源索引:http
://gems.rubyforge.org/ 错误:安装 rubygems-update 时出错:
rubygems-update 需要构建器 (>= 0)
错误:在本地或存储库中找不到 update_rubygems
Then I checked, as suggested by theIVon a similar question, whether I had http://gems.rubyforge.org/in my remote sources. Here's the gems environment:
然后,按照theIV在类似问题上的建议,我检查了我的远程资源中是否有http://gems.rubyforge.org/。这是 gems 环境:
RubyGems Environment:
- RUBYGEMS VERSION: 1.1.1
- RUBY VERSION: 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-9
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org
RubyGems 环境:
- RUBYGEMS 版本:1.1.1
- RUBY 版本:1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
- 安装目录:/Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- RUBYGEMS 平台:
- ruby
- Universal-darwin-9
- GEM 路径:
- /Library/Ruby/Gems/1.8
- /System/Library/ Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM 配置:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- 远程资源:
- http://gems.rubyforge.org
So, yeah, any ideas?
所以,是的,有什么想法吗?
采纳答案by Steve Madsen
There is no need to take such drastic steps as completely rebuilding Ruby, reinstalling Rubygems from scratch or installing a version manager to solve this problem. There is simply a dependency cycle introduced by the release of hoe 2.3.0:
无需采取完全重建 Ruby、从头重新安装 Rubygems 或安装版本管理器等大刀阔斧的步骤来解决此问题。hoe 2.3.0 的发布引入了一个简单的依赖循环:
rubygems-update 1.3.5 requires (among other things) hoe-seattlerb
hoe-seattlerb requires hoe >= 2.3.0
hoe >= 2.3.0 requires rubygems >= 1.3.1
rubygems-update 1.3.5 需要(除其他外)hoe-seattlerb
hoe-seattlerb 需要 hoe >= 2.3.0
hoe >= 2.3.0 需要 rubygems >= 1.3.1
I wrote the blog postlinked to by zipizap. To recap:
- If you've already tried to update, uninstall the latest rubygems-update first:
sudo gem uninstall rubygems-update -v 1.3.5 - Update to 1.3.0:
sudo gem install rubygems-update -v 1.3.0 sudo update_rubygems- Then update to latest:
sudo gem update --system
- 如果您已经尝试更新,请先卸载最新的 rubygems-update:
sudo gem uninstall rubygems-update -v 1.3.5 - 更新到 1.3.0:
sudo gem install rubygems-update -v 1.3.0 sudo update_rubygems- 然后更新到最新:
sudo gem update --system
With the release of Rubygems 1.3.6, it looks like this problem may be gone. From the release notes:
随着 Rubygems 1.3.6 的发布,这个问题看起来可能会消失。从发行说明:
- Development deps are no longer added to rubygems-update gem so older versions can update sucessfully.
- 开发部门不再添加到 rubygems-update gem 中,因此旧版本可以成功更新。
回答by BigBrother
Oi - I feel your pain. I'll first ask the obvious; Have you been executing the commands with sudo? So you'll use sudo gem install rubygems-updateand sudo update_rubygems.
Oi - 我感觉到你的痛苦。我会先问显而易见的;您是否一直在使用 sudo 执行命令?因此,您将使用sudo gem install rubygems-update和sudo update_rubygems。
If that doesn't work, download gems source again and rebuild from scratch (may want to erase prior source download, etc). You may want to read HiveLogic article on installing Ruby, RubyGems, etc on Mac OS Snow Leopard.
如果这不起作用,请再次下载 gems 源并从头开始重建(可能想要删除先前的源下载等)。您可能想阅读有关在 Mac OS Snow Leopard 上安装 Ruby、RubyGems 等的 HiveLogic 文章。
If that doesnt' work... :) I might do the drastic and rebuild Ruby as well.
如果那不起作用... :) 我也可能会大刀阔斧地重建Ruby。
回答by Ruben
Similar problem, different solution
类似的问题,不同的解决方案
$ sudo gem install rubygems-update update_rubygems
Updating metadata for 1 gems from gems.rubyforge.org/
.
complete
ERROR: Error installing rubygems-update:
rubygems-update requires builder (>= 0)
ERROR: could not find update_rubygems locally or in a repository
and
和
$ sudo gem update --system
ERROR: While executing gem ... (RuntimeError)
gem update --system is disabled on Debian. RubyGems can be updated using the official Debian repositories by aptitude or apt-get.
My solution: Go to http://docs.rubygems.org/read/chapter/3#page13
我的解决方案:转到http://docs.rubygems.org/read/chapter/3#page13
and install manually, i.e. get the rubygems.... tgz and install it.
并手动安装,即获取 rubygems.... tgz 并安装它。
Hope it helps someone.
希望它可以帮助某人。
回答by MattMcKnight
Any luck with gem install builder? That looks to be what you need to get rubygems-update to install.
运气gem install builder好吗?这看起来是安装 rubygems-update 所需要的。
回答by Glenn
I ran into a similar issue, and I was able to upgrade by doing this: sudo gem update --system
我遇到了类似的问题,我可以通过这样做来升级: sudo gem update --system
回答by zipizap
The problem seems to be detected and reported as a dependecy-cycle: some new-version-dependencies are needed in order to install the new-gems-version... yes, it is a mess.The recomended solution I've seen is to make the upgrade in a step-by-step intermediate version fashion, in order to make the upgrade transition smooth, with small version-gaps. Read it in this article, which explains it very well: link text
这个问题似乎被检测到并报告为一个依赖循环:为了安装新的宝石版本,需要一些新版本的依赖......是的,它是一团糟。我看到的推荐解决方案是逐步进行中间版本升级,使升级过渡平滑,版本差距小。在这篇文章中阅读它,它很好地解释了它: 链接文本
After reading it and trying a couple of times, I've seen that it was still very fuzzy/complicated.
在阅读并尝试了几次之后,我发现它仍然非常模糊/复杂。
So I went for another solution, which installs more then necesary but is more straighforward:
所以我选择了另一种解决方案,它安装得更多,但更直接:
Install a more recent version of ruby + irb + rdoc + gem (side by side with old version already existing)
Now install the gem "Ruby Version Manager" (a no pain in debian/ubuntu, it can compile latest ruby version) link text
Use RVM to install the final and latest ruby version (side-by-side again) and maintain it updated.
(you could now use RVM to uninstall the older versions of ruby/gems in your system, and only keept the latest ruby version)
安装更新版本的 ruby + irb + rdoc + gem(与旧版本并排安装)
现在安装 gem “Ruby Version Manager”(在 debian/ubuntu 中没有痛苦,它可以编译最新的 ruby 版本)链接文本
使用 RVM 安装最终和最新的 ruby 版本(再次并排)并保持更新。
(您现在可以使用 RVM 卸载系统中旧版本的 ruby/gems,并且只保留最新的 ruby 版本)
If you need it for a production system, RVM is already seen as mature enough to maintain ruby/gems updated with newer versions.
如果您需要将它用于生产系统,RVM 已经被视为足够成熟,可以维护更新版本的 ruby/gems。
Hope it helps some starter like me to "get toubles out of the way"
希望它可以帮助像我这样的初学者“摆脱困境”
回答by Azeem.Butt
Re-build it from the sources.
从源头重新构建它。

