Not signed in (Sign In)
    • CommentAuthorsuresk
    • CommentTimeAug 6th 2007
     permalink
    I'm setting my new slice up, and am having trouble getting Gems to work. I've installed Ruby and Gems just fine, but when I go to install something (like Rails or Capistrano), it gets stuck on:

    "Updating Gem source index for: http://gems.rubyforge.org"

    I've let it run for over an hour, but still nothing happens. It is also using up all of my RAM, from what I can tell.

    Has anyone else run into this?

    Thanks.
  1.  permalink
    I've had that exact same problem, too.

    I asked the Slicehost crew about it, and they didn't really know what was up. If this is a problem for more than just me, though, perhaps we can join forces to figure it out.

    I'm running Debian Etch.
    •  
      CommentAuthorjuzzin
    • CommentTimeSep 21st 2007 edited
     permalink

    On a smaller Slice?

    1. Get gem path: gem env gem (e.g. /usr/local/lib/ruby/gems/1.8)
    2. rm /usr/local/lib/ruby/gems/1.8/source_cache

    or

    1. sudo gem sources —clear-all

    Try installing your gem.

  2.  permalink
    juzzin's solution will work if you have already updated or already install a gem via 'gem install' or 'gem update' but until then there is no source_cache.

    The problem you describe happened to me once a week or so ago and could not figure out why - it worked fine the next time (and all the times since).

    When you install gems for the first time ensure you complete a:

    gem update
    gem update --system

    The first will create the source_cache and the second will then use the cache and update the system.

    If you go straight to a gem update --system it will fail with an error as the source_cache does not exist (it is created with the first command).

    It is an odd way of doing things and I think there are few bugs like this that need sorting out.

    This will also apply if you delete the source_cache - you will need to complete a gem update to create the source_cache file. If you don't the next command you give (a.g. gem install rails) will fail as the source_cache does not exist.

    PickledOnion.
  3.  permalink
    Well, that'll teach me to say it was fine.

    I can't do anything with gems this morning - updates, install, everything stalls and consumes all memory and swap until the system stops.

    I will investigate but have no real idea what is going on.

    From a sad PickledOnion.

    edit:

    OK, it seems to be a relatively common issue and one that may get worse as more and more gems become available.

    The bulk update seems to load all the gems into memory and then have a look around and update them - this will also happen on a gem install as it updates any existing gems at the same time - in effect it loads all the gems into memory and then tries to install more.

    The issue has been reported upstream by a couple of people but is something the gem masters will have to sort out.

    The best thing to do is to stop all services that are not needed to free as much memory as possible - I am working on a test server and actually did a reinstall but it still choked a few times (256 Slice).

    I also found that instead of:

    sudo gem install rails --include-dependencies

    do a:

    sudo gem install rails

    You will have to answer each dependency by hand but it was the only way I could get through the install but it still took 256MB ram and 150MB of swap.

    Not impressed but there is not a lot we can do about it.

    Obviously, I will be delighted if anyone has any other thoughts or solutions as I am now 2+ hours into installing rails and mongrels. grrr.

    /edit
    Thankful People: ilikepi
    •  
      CommentAuthorjuzzin
    • CommentTimeSep 21st 2007 edited
     permalink

    When rubygems is being bad, I’ve taken to just downloading the gem and installing it from file. For slicers, especially those on smaller slices, this is probably the simplest solution.

    •  
      CommentAuthorjuzzin
    • CommentTimeSep 21st 2007 edited
     permalink

    I haven’t tried this myself, so, TIAYOR:

    1. Install beta rubygem: gem update —system —source http://onestepback.org/betagems
    or download/install from file: http://onestepback.org/betagems/gems/rubygems-update-0.9.4.3.gem

    2. gem -v should return 0.9.4.3 or greater

    The beta has a new option, ‘-B’ which sets a bulk download threshold. This is supposed to load the gems incrementally, reducing memory consumption at the cost of added time. It defaults to 500.

    e.g. gem list -r -B 1000

    You can also set the threshold in the .gemrc file. (easier than passing -B constantly)

    From post:
    http://www.mail-archive.com/rubygems-developers@rubyforge.org/msg00925.html

  4.  permalink
    We were discussing this and we came to the same conclusion: download and install locally.

    You can get the list of dependencies with a:

    gem dependency rails

    which would give:

    Gem rails-1.2.3
    rake (>= 0.7.2)
    activesupport (= 1.4.2)
    activerecord (= 1.15.3)
    actionpack (= 1.13.3)
    actionmailer (= 1.3.3)
    actionwebservice (= 1.2.3)

    Another option may be to add the --no-rdoc --no-ri option to the gem install.

    However, the beta rubygem looks interesting so it does look as if it's being addressed. Thanks for the link juzzin.
    •  
      CommentAuthorjuzzin
    • CommentTimeSep 21st 2007
     permalink

    Using the beta and haven’t had any trouble. Updates work great.

    • CommentAuthortrevorturk
    • CommentTimeSep 23rd 2007
     permalink
    Is there some action we might take to report the issue to the gem masters, or is this a known problem already?
    •  
      CommentAuthorjuzzin
    • CommentTimeSep 23rd 2007 edited
     permalink

    It’s a known issue. The beta includes improvements that help resolve the problem. An upcoming repository fix will also help considerably.

    I’m using the beta successfully.

    •  
      CommentAuthorMichaelT
    • CommentTimeSep 23rd 2007
     permalink

    I always thought this problem was Rubyforge, not Rubygems. On any odd day I may get that exact hang-up, but mostly it is fine.

    •  
      CommentAuthorjuzzin
    • CommentTimeSep 23rd 2007
     permalink

    The rubygem YAML index is getting quite large. Look at the memory consumption the next time a bulk update is performed. This is causing a lot of problems for users without much memory to spare.

    http://gems.rubyforge.org/yaml <- index

    If that’s up, and your memory usage is too, then it’s rubygems. :)

    •  
      CommentAuthorMichaelT
    • CommentTimeSep 24th 2007
     permalink

    that’s great I am going to spot that… great gear!

  5.  permalink
    Ive been having problems with updating gems too and the beta mentioned above seems to fix things up nicely. Cheers!
    •  
      CommentAuthorMichaelT
    • CommentTimeSep 26th 2007
     permalink

    I am having this issue as we speak (so to speak.. hehe). My Rails install was done via:

    sudo gem install rails --no-rdoc --no-ri

    That is ‘gem -v’ = 0.9.2

    Then I did (as per juzzin’s comment)

    rm /usr/local/lib/ruby/gems/1.8/source_cache

    sudo gem update --system

    Might have to run that one twice before you get a hook.

    Then ‘gem -v’ = 0.9.4

    Still slow on ‘gem update’. So reboot my slice and all is fine quick and snappy.

    Thankful People: joealba
    • CommentAuthortrevorturk
    • CommentTimeOct 17th 2007
     permalink
    Seems like the new beta version of RubyGems solves this issue:

    http://www.infoq.com/news/2007/10/ruby-gems-release
    http://blog.segment7.net/articles/2007/10/13/rubygems-beta-0-9-4-5

    You just need to ssh onto your server and run:

    gem update --system --source http://segment7.net/
    Thankful People: tolbrino, bentglasstube
    •  
      CommentAuthorGeoff
    • CommentTimeOct 27th 2007 edited
     permalink
    Ah, thanks! The
    gem update --system --source http://segment7.net/ solution worked for me as well!
    •  
      CommentAuthorGeoff
    • CommentTimeOct 27th 2007
     permalink
    FYI:

    All,

    Just to let you know there is an unknown problem right now with the
    gems service on RubyForge that folks thought was Leopard related but
    its not...I get the same thing in Tiger (and other OSes may get the
    same):

    gem search --remote jabber

    *** REMOTE GEMS ***
    Bulk updating Gem source index for: http://gems.rubyforge.org
    ERROR: While executing gem ... (TypeError)
    can't instantiate uninitialized class

    We will identify the problem as soon as is possible and fix it...just
    want to let folks know so you can know that your shinny new OS is OK ;-)

    Best,

    Rich


    http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/276074
    • CommentAuthorgcnovus
    • CommentTimeNov 20th 2007
     permalink

    I'm trying to update to RubyGems 0.9.5 as Geoff recommends, but I get this:




    sudo gem update --system --source http://segment7.net/
    Updating RubyGems...
    Need to update 3 gems from http://segment7.net/
    ...
    complete
    Attempting remote update of rubygems-update
    ERROR: While executing gem ... (Gem::GemNotFoundException)
    Could not find rubygems-update (> 0) in any repository


    Thoughts?
    -Gaius