Duplicate Gems

ant's Avatar

ant

02 Jul, 2011 01:18 PM

Hello..

I noticed my /var/lib/gems/1.8/specifications has tons of gem duplicates:

# ls -all /var/lib/gems/1.8/specifications
total 184
drwxr-xr-x 2 root root  4096 Jul  2 06:12 .
drwxr-xr-x 7 root root  4096 Jul  2 05:38 ..
-rw-r--r-- 1 root root  1684 Aug 26  2010 babelfish-0.0.1.gemspec
-rw-r--r-- 1 root root 28687 Mar 18  2010 gettext-2.1.0.gemspec
-rw-r--r-- 1 root root  2921 Jul  1 10:23 hoe-2.10.0.gemspec
-rw-r--r-- 1 root root  2934 Jun 22 05:34 hoe-2.9.5.gemspec
-rw-r--r-- 1 root root  2928 Jun 23 04:20 hoe-2.9.6.gemspec
-rw-r--r-- 1 root root  2442 Mar  9 06:59 hpricot-0.8.4.gemspec
-rw-r--r-- 1 root root  1152 Mar 31 05:29 htmlentities-4.3.0.gemspec
-rw-r--r-- 1 root root  1332 Nov  1  2010 htmltools-1.10.gemspec
-rw-r--r-- 1 root root  1633 Jun 22 05:34 json-1.5.3.gemspec
-rw-r--r-- 1 root root  1443 Jun 22 05:34 json_pure-1.5.3.gemspec
-rw-r--r-- 1 root root  2101 Mar 18  2010 locale-2.0.5.gemspec
-rw-r--r-- 1 root root  9099 Aug 26  2010 mechanize-1.0.0.gemspec
-rw-r--r-- 1 root root  3774 Jun 29 06:45 mechanize-2.0.1.gemspec
-rw-r--r-- 1 root root  3609 Jun 28 06:30 mechanize-2.0.gemspec
-rw-r--r-- 1 root root  2636 Jun 28 06:30 net-http-digest_auth-1.1.1.gemspec
-rw-r--r-- 1 root root  2980 Jun 28 06:30 net-http-persistent-1.8.gemspec
-rw-r--r-- 1 root root  4384 Jun 22 05:34 nokogiri-1.4.6.gemspec
-rw-r--r-- 1 root root  5326 Jul  1 10:23 nokogiri-1.5.0.gemspec
-rw-r--r-- 1 root root  3796 Apr 18 13:10 oauth-0.4.4.gemspec
-rw-r--r-- 1 root root  2224 Jun 26 07:40 oauth-0.4.5.gemspec
-rw-r--r-- 1 root root  1483 Mar 18  2010 port-0.9.0-x86-linux.gemspec
-rw-r--r-- 1 root root  2556 Jun 22 05:34 rake-0.8.7.gemspec
-rw-r--r-- 1 root root  3302 Jun  7 06:20 rake-0.9.2.gemspec
-rw-r--r-- 1 root root  1175 Apr 30  2010 require-0.2.7.gemspec
-rw-r--r-- 1 root root  1946 Nov  1  2010 rubyforge-2.0.4.gemspec
-rw-r--r-- 1 root root  1348 Nov  1  2010 rubyful_soup-1.0.4.gemspec
-rw-r--r-- 1 root root  1808 Nov  1  2010 shorturl-0.8.8.gemspec
-rw-r--r-- 1 root root  1421 Nov  1  2010 tinyurl-1.0.0.gemspec
-rw-r--r-- 1 root root  1251 Aug 26  2010 trollop-1.16.2.gemspec
-rw-r--r-- 1 root root  1020 Jun 14 03:23 tzinfo-0.3.28.gemspec
-rw-r--r-- 1 root root  1020 Jun 28 06:30 tzinfo-0.3.29.gemspec
-rw-r--r-- 1 root root  1774 Jul  2 05:57 webrobots-0.0.10.gemspec
-rw-r--r-- 1 root root   698 Jun 19 08:07 xml-simple-1.1.0.gemspec

Can I safely delete the older versions? If so, then do I do it manually with rm command or something else? I am new to Gem/Ruby stuff.

Thank you in advance. :)

  1. 1 Posted by Ant on 10 Jul, 2011 04:43 PM

    Ant's Avatar

    No replies? :(

  2. Support Staff 2 Posted by Nick Quaranto on 23 Sep, 2011 03:12 PM

    Nick Quaranto's Avatar

    This one was buried in our spam filter, just unearthed it. Sorry.

    They're not duplicates, they're different versions of gems installed on your system. Personally I wouldn't mess with it.

    If you need a better way of handling this kind of thing, take a look into RVM gemsets:

    http://beginrescueend.com/gemsets/basics/

  3. 3 Posted by ant on 23 Sep, 2011 05:14 PM

    ant's Avatar

    Thanks. So I need all of them installed? :( They hog a lot of disk space.

  4. Support Staff 4 Posted by Nick Quaranto on 23 Sep, 2011 07:46 PM

    Nick Quaranto's Avatar

    I'm not sure what your application depends on, so I can't answer that correctly. If you're using RVM and/or Bundler it becomes way easier to manage this kind of stuff.

  5. 5 Posted by ant on 23 Sep, 2011 07:48 PM

    ant's Avatar

    I only use Ruby for Rbot as shown in http://ruby-rbot.org/ ...

  6. Support Staff 6 Posted by Nick Quaranto on 12 Oct, 2011 01:56 PM

    Nick Quaranto's Avatar

    I think the best way here is to just use RVM & Bundler if you want to really control what gems you have and make it repeatable. You could just uninstall every gem on your box without these tools but it's going to be more maintainable and easier to manage for others to help you hacking on it if you use either (or both, preferably Bundler).

  7. Nick Quaranto closed this discussion on 12 Oct, 2011 01:56 PM.

  8. Eric Hodel re-opened this discussion on 12 Oct, 2011 09:30 PM

  9. Support Staff 7 Posted by Eric Hodel on 12 Oct, 2011 09:30 PM

    Eric Hodel's Avatar

    Alternately, you can run gem cleanup to get rid of old versions

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

30 Oct, 2014 04:34 PM
30 Oct, 2014 02:46 PM
28 Oct, 2014 09:51 AM
23 Oct, 2014 05:37 PM
21 Oct, 2014 10:47 AM