It appears that if you install rubygems under a non-standard prefix
then “gem update --system” breaks.
I have rubygems installed as a non-privileged user. Everything works
fine with GEM_HOME and RUBYLIB set properly in the environment. But,
when I try to upgrade rubygems from 0.9.1 -> 0.9.2 , “gem update
setup.rb:515:in `initialize’: Permission denied - /usr/bin/gem
Running “update_rubygems” manually doesn’t fair any better.
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
Eventually I found a successful workaround…
cd $GEM_HOME/gems/rubygems-update-*/ &&
ruby setup.rb all --prefix=$GEM_PREFIX
…where $GEM_PREFIX is the prefix I installed rubygems to. I’m glad
that it worked, but surely it should be easier than this? It would be
nice if “gem update --system” accepted --prefix=$GEM_PREFIX , but as
far as I can tell it does not.