Can't update RubyGems

前端 未结 8 2561
臣服心动
臣服心动 2021-02-19 23:40

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

gem update

Result:

相关标签:
8条回答
  • 2021-02-19 23:40

    I ran into a similar issue, and I was able to upgrade by doing this: sudo gem update --system

    0 讨论(0)
  • 2021-02-19 23:44

    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"

    0 讨论(0)
  • 2021-02-19 23:48

    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

    and install manually, i.e. get the rubygems.... tgz and install it.

    Hope it helps someone.

    0 讨论(0)
  • 2021-02-19 23:53

    NOTE: RubyGems 1.1 and 1.2 have problems upgrading when there is no rubygems-update installed. You will need to use the following instructions if you see Nothing to update. If you have an older version of RubyGems installed, then you can still do it in two steps:

    $ gem install rubygems-update  # again, might need to be admin/root
    $ update_rubygems              # ... here too
    
    0 讨论(0)
  • 2021-02-19 23:55

    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:

    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

    I wrote the blog post linked to by zipizap. To recap:

    1. If you've already tried to update, uninstall the latest rubygems-update first: sudo gem uninstall rubygems-update -v 1.3.5
    2. Update to 1.3.0: sudo gem install rubygems-update -v 1.3.0
    3. sudo update_rubygems
    4. Then update to latest: sudo gem update --system

    With the release of Rubygems 1.3.6, it looks like this problem may be gone. From the release notes:

    • Development deps are no longer added to rubygems-update gem so older versions can update sucessfully.
    0 讨论(0)
  • 2021-02-20 00:00

    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-update and 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.

    If that doesnt' work... :) I might do the drastic and rebuild Ruby as well.

    0 讨论(0)
提交回复
热议问题