getting rid of ruby gems that won't die

后端 未结 7 1399
鱼传尺愫
鱼传尺愫 2020-12-08 01:27

I\'ve got a few ruby gems that won\'t go away.

I think it has to do with when I installed them. Occasionally I have forgotten to use \"sudo\" before doing a gem i

相关标签:
7条回答
  • 2020-12-08 01:43

    You could also do the following to get rid of installed gems.

    gem list -d [gem name]
    gem uninstall --install-dir [install directory] [gem name]
    

    if the before mentioned things don't work, I had to do it myself today.

    0 讨论(0)
  • 2020-12-08 01:44

    update your version of ruby gems gem update --system then hopefully gem uninstall xxx will work right now [was a bug in older versions]

    0 讨论(0)
  • 2020-12-08 01:45

    Assuming that gem clean (or sudo gem clean) doesn't work, I would try the following to totally remove all gems from your system:

    You can see where gems have been installed by running the command:

    gem env paths
    

    To remove all the gems on your system, simply remove the folders returned by this command.

    Additionally, on OSX Leopard, default gems are installed in this folder:

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
    

    If this folder exists on your system, as before you can remove this folder to ensure all gems are deleted.

    0 讨论(0)
  • 2020-12-08 01:45

    Check out RVM, it allows you to completely manage your ruby environment under your user rather than in a system directory. I've found it much easier to manage ruby versions and gems using it.

    0 讨论(0)
  • 2020-12-08 01:51

    If you have multiple versions of a gem, you will have to first do a clean up and then delete the final gem.

     gem cleanup <gemname>
     gem uninstall <gemname> --version
    
    0 讨论(0)
  • 2020-12-08 01:52

    I had a gem that would not die and had to go the "nuke everything" route by deleting all my gems with the command gem uninstall -aIx. Then just gem install <gemname> and I was back up and running.

    0 讨论(0)
提交回复
热议问题