Code Monkey home page Code Monkey logo

Comments (6)

wapcaplet avatar wapcaplet commented on May 18, 2024

Ditto. Example:

$ ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-linux]
$ gem -v
1.8.5

$ gem list cucumber
*** LOCAL GEMS ***
cucumber (1.0.0)
cucumber-rails (0.5.1)

$ gem uninstall cucumber cucumber-rails -aIx
Removing cucumber
Successfully uninstalled cucumber-1.0.0
ERROR:  While executing gem ... (Gem::InstallError)
    cannot uninstall, check `gem list -d cucumber-rails`

$ gem uninstall cucumber-rails -aIx
Successfully uninstalled cucumber-rails-0.5.1

The only workaround I have found is to uninstall gems one by one, which is very tedious.

from rubygems.

blackwinter avatar blackwinter commented on May 18, 2024

I've tracked it down to the following:

  1. I have /usr/lib/ruby/gems/1.8 and ~/.gem/ruby/1.8 in my GEM PATHS
  2. For the first gem, Gem::Uninstaller#initialize effectively calls Gem.use_paths '~/.gem/ruby/1.8', '/usr/lib/ruby/gems/1.8' which sets Gem.dir to ~/.gem/ruby/1.8
  3. For the second gem, Gem::Uninstaller#initialize effectively calls Gem.use_paths '~/.gem/ruby/1.8', '~/.gem/ruby/1.8', because Gem.dir is now ~/.gem/ruby/1.8

Not sure what a fix should look like. I'm not too familiar with the code base and it feels like Gem.dir and Gem.path are mixed up in several places (gem cleanup has a similar problem; see #153). Comments in the source seem to indicate that this is something that is going to be refactored.

Workaround: gem uninstall --no-user-install ...

from rubygems.

blackwinter avatar blackwinter commented on May 18, 2024

Not sure if 3653f2c was supposed to fix this (it says "Fixed uninstalling multiple gems using gem uninstall"), but for me the issue remains. Tests pass, though.

from rubygems.

vandrijevik avatar vandrijevik commented on May 18, 2024

1.8.9 fixes this issue for me.

from rubygems.

blackwinter avatar blackwinter commented on May 18, 2024

Definitely not the case here:

$ gem192 install exifr xmp
Fetching: exifr-1.0.6.gem (100%)
Successfully installed exifr-1.0.6
Fetching: xmp-0.2.0.gem (100%)
Successfully installed xmp-0.2.0
2 gems installed
$ gem192 uninstall -x xmp exifr
Successfully uninstalled xmp-0.2.0
ERROR:  While executing gem ... (Gem::InstallError)
    gem "exifr" is not installed
$ gem192 uninstall -x exifr
Removing exifr
Successfully uninstalled exifr-1.0.6

It seems, the only thing this update did for me was break the workaround :(

P.S.:

$ gem192 env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.9
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/jw/.multiruby/install/mri_1_9_2/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /home/jw/.multiruby/install/mri_1_9_2/bin/ruby
  - EXECUTABLE DIRECTORY: /home/jw/.multiruby/install/mri_1_9_2/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/jw/.multiruby/install/mri_1_9_2/lib/ruby/gems/1.9.1
     - /home/jw/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
     - :sources => ["http://rubygems.org/", "http://prometheus-app.uni-koeln.de/rubygems/"]
  - REMOTE SOURCES:
     - http://rubygems.org/
     - http://prometheus-app.uni-koeln.de/rubygems/

from rubygems.

blackwinter avatar blackwinter commented on May 18, 2024

That did it. Thanks!

from rubygems.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.