From: Eric Hodel Date: 2009-03-05T09:41:00+09:00 Subject: Re: gem cleanup problem On Mar 4, 2009, at 12:56, Tom Cloyd wrote: > Eric Hodel wrote: >>> $ sudo gem cleanup >>> Cleaning up installed gems... >>> Attempting to uninstall bones-2.3.1 >>> ERROR: While executing gem ... (Gem::InstallError) >>> Unknown gem bones = 2.3.1 >>> tomc@tomc-desktop:~$ >>> >>> I don't understand the problem here. Can anyone offer me a clue? >> >> gem cleanup doesn't handle multiple gem repos well yet, this may be >> your problem: >> >> $ gem list -d rails >> >> *** LOCAL GEMS *** >> >> rails (2.2.2, 1.2.6) >> Author: David Heinemeier Hansson >> Rubyforge: http://rubyforge.org/projects/rails >> Homepage: http://www.rubyonrails.org >> Installed at (2.2.2): /Library/Ruby/Gems/1.8 >> (1.2.6): /System/Library/Frameworks/Ruby.framework/ >> Versions/1.8/usr/lib/ruby/gems/1.8 >> [...] >> $ sudo gem cleanup rails >> Password: >> Cleaning up installed gems... >> :0:Warning: Gem::SourceIndex#search support for Regexp patterns is >> deprecated >> Attempting to uninstall rails-1.2.6 >> ERROR: While executing gem ... (Gem::InstallError) >> Unknown gem rails = 1.2.6 >> $ >> >> > Bingo. That's it. I have ruby 1.8.7 installed, and recently > installed 1.9 as well. It never occurred to me that Rubygems was > catching both installs, and that is clearly the case. Hadn't used > the 'gem list -d {}' command until I read your email. Problem > explained, if not solved. Interesting.... I forgot the workaround: sudo sh -c 'GEM_PATH=`gem env home` gem cleanup'