Can't update RubyGems

2019-04-05 03:13发布

I'm having difficulties updating RubyGems from version 1.1.1 to newest. I've tried the following:

gem update

Result:

Updating installed gems
Bulk updating Gem source index for: http://gems.rubyforge.org/
Nothing to update

and

gem install rubygems-update

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)

and

gem install rubygems-update 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

Then I checked, as suggested by theIV on a similar question, whether I had http://gems.rubyforge.org/ in my remote sources. Here's the gems environment:

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

So, yeah, any ideas?

7条回答
【Aperson】
2楼-- · 2019-04-05 03:40

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)

If you need it for a production system, RVM is already seen as mature enough to maintain ruby/gems updated with newer versions.

Hope it helps some starter like me to "get toubles out of the way"

查看更多
登录 后发表回答