From: spox Date: 2009-10-09T06:43:45+09:00 Subject: Re: Difficulty updating Ruby Gems in a non-standard location On Thursday 08 October 2009 01:51:33 pm David Brodbeck wrote: > On Oct 8, 2009, at 11:28 AM, Aaron Patterson wrote: > > On Oct 8, 2009, at 10:53 AM, David Brodbeck wrote: > >> I have Ruby Gems installed in a non-standard location. Both > >> $GEM_PREFIX and $GEM_HOME are set. I'm attempting to update from > >> 0.9.4 to 1.3.5, without success. > >> > >> First attempt: I tried "gem update --system". This didn't work > >> because it ignored $GEM_PREFIX and installed in the wrong location. > >> > >> Second attempt: I tried the instructions here: > >> http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/243916 This > >> completely broke gem; every time I tried to do something with it I got > >> this error: > >> /opt/ruby-gems/bin/gem:14: undefined method `ruby_version' for > >> Gem:Module (NoMethodError) > >> > >> Third attempt: I restored my gem directory from backup and tried > >> "gem install rubygems-update && update_rubygems". This gave the > >> following error: > >> Error: Cannot find RubyGems Update Path! > >> > >> RubyGems has already been updated. > >> The rubygems-update gem may now be uninstalled. > >> E.g. gem uninstall rubygems-update > >> > >> So, now I'm stumped. How do I update Ruby Gems if it's not > >> installed in the standard location? > > > > I would suggest downloading the tar.gz and running setup.rb (making > > sure GEM_PREFIX and GEM_HOME are set). That might clear up your > > problems. > > > > You can grab the tar.gz file here: > > > > http://rubyforge.org/frs/?group_id=126 > > Unfortunately, that failed in the same way "gem update --system" did > -- it ignored $GEM_PREFIX and tried to install gem under /usr/bin/ > gem. The gem installation in /opt/ruby-gems was left untouched. Using the source you downloaded, make sure that GEM_HOME is exported, then run setup with the prefix to the install location: ruby setup.rb --prefix=/opt/ruby-gems - spox