gem cleanup is now spitting out errors
I recently updated my rubygems (1.8.8) and individual installed gems. When I went to cleanup the old code from previous versions, I'm getting tens of errors like this:
Unable to uninstall mail-2.2.19:
Gem::InstallError: gem "mail" is not installed
Where they are clearly there:
gem list
mail (2.3.0, 2.2.19)
Is this a new bug that's been introduced or is there an incompatibility with how the older gems were crafted. The latter being the case, what's the right way to correct/fix this?
I did see in previous articles that the solution was to upgrade rubygems; that is not the case here, as I'm running the latest code. Presumably :-)
Thanks!
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Luis Lavena on 19 Aug, 2011 07:30 PM
Issue already addressed at RubyGems bug tracker:
https://github.com/rubygems/rubygems/issues/148
And will be part of next release.
Thank you for reporting.
Luis Lavena closed this discussion on 19 Aug, 2011 07:30 PM.
Luis Lavena re-opened this discussion on 19 Aug, 2011 07:31 PM
Support Staff 3 Posted by Luis Lavena on 19 Aug, 2011 07:32 PM
Sorry, confused this issue with the already reported issues of gem cleanup command.
Please provide the complete output of
gem envandgem list -d mailalong withgem cleanup mail --debug -VThank you.
4 Posted by forrie on 19 Aug, 2011 07:44 PM
Thanks for replying. Sorry I didn't pick up on that thread. I also forgot to mention I'm running Ruby Enterprise, which may factor into the problems.
# gem env RubyGems Environment: - RUBYGEMS VERSION: 1.8.8 - RUBY VERSION: 1.8.7 (2011-02-18 patchlevel 334) [i686-linux] - INSTALLATION DIRECTORY: /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /opt/ruby-enterprise-1.8.7-2011.03/bin/ruby - EXECUTABLE DIRECTORY: /opt/ruby-enterprise-1.8.7-2011.03/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8 - /home/faldrich/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://rubygems.org/(using a different gem)
# gem list -d rack-mount *** LOCAL GEMS *** rack-mount (0.8.2, 0.8.1, 0.6.14) Author: Joshua Peek Homepage: https://github.com/josh/rack-mount Installed at (0.8.2): /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8 (0.8.1): /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8 (0.6.14): /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8 Stackable dynamic tree based Rack routerand..
# gem cleanup rack-mount --debug -V Exception `NameError' at /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::CleanupCommand Cleaning up installed gems... Attempting to uninstall rack-mount-0.8.1 Exception `Errno::ENOENT' at /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/1.8/fileutils.rb:1209 - No such file or directory - /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/ri/rack-mount-0.8.1-ruby Exception `Errno::ENOENT' at /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/1.8/fileutils.rb:1209 - No such file or directory - /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/ri/rack-mount-0.8.1-ruby Exception `Errno::ENOENT' at /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/1.8/fileutils.rb:1304 - No such file or directory - /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/gems/1.8/ri/rack-mount-0.8.1-ruby Successfully uninstalled rack-mount-0.8.1 Attempting to uninstall rack-mount-0.6.14 Exception `Gem::InstallError' at /opt/ruby-enterprise-1.8.7-2011.03/lib/ruby/site_ruby/1.8/rubygems/uninstaller.rb:73 - gem "rack-mount" is not installed Unable to uninstall rack-mount-0.6.14: Gem::InstallError: gem "rack-mount" is not installed Clean Up CompleteYikes, the Markup/Markdown on this site is not the best...
Edit: always use the friendly
pretags ;-)Support Staff 5 Posted by Luis Lavena on 19 Aug, 2011 07:49 PM
OK, so it seems you attempted to uninstall a gem that is installed in
/opt/ruby-enterprise-but you didn't use sudo.So it cannot cleanup a gem that is not accessible.
Seems you're not running as root, so that could be the reason.
Can you try
sudo gem cleanup rack-mount?6 Posted by forrie on 19 Aug, 2011 07:50 PM
I didn't sudo as I'm working in a root shell.
=]
Support Staff 7 Posted by Luis Lavena on 19 Aug, 2011 07:54 PM
Hmn, then why
/home/faldrich/.gem/ruby/1.8is displayed in the GEM PATHs? :-PPerhaps is the issue I first linked associated with it?
Can you checkout rubygems source, checkout 1.8 branch and run:
ruby -Ilib bin/gem cleanup rack-mount8 Posted by forrie on 19 Aug, 2011 08:06 PM
I didn't see that. But I removed my .gem directory -- I don't know how
it got there to begin with.
I downloaded the latest tgz, which happens to be 1.8.7 -- worked on a
couple of gems:
# ruby -Ilib bin/gem cleanup actionpack
Cleaning up installed gems...
Attempting to uninstall actionpack-3.0.9
You have requested to uninstall the gem:
actionpack-3.0.9
actionmailer-3.0.9 depends on [actionpack (= 3.0.9)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] y
Successfully uninstalled actionpack-3.0.9
Clean Up Complete
But using a plain cleanup still spits out all the errors I posted about.
Support Staff 9 Posted by Luis Lavena on 19 Aug, 2011 08:13 PM
Let me rephrase my comment:
Please clone RubyGems repository, not the latest available package.
As I linked before, there was an issue of cleanup command that was solved but not yet released.
Repository is here:
https://github.com/rubygems/rubygems/
git clone http://github.com/rubygems/rubygems/ && cd rubygemsThen:
git checkout 1.8And try the command I mentioned before.
10 Posted by forrie on 19 Aug, 2011 08:17 PM
I manually iterated over the list of items and now I'm getting a clean
"gem cleanup" from the system.
That's not to say that this won't happen again... I did noticed that
when I got down to 2 or 3 gems left, it was able to handle them on their
own.
Support Staff 11 Posted by Luis Lavena on 23 Aug, 2011 05:11 PM
It has been reported as a bug and solved in the codebase, yet not still released as an update.
Thank you for your report.
Luis Lavena closed this discussion on 23 Aug, 2011 05:11 PM.