Duplicate Gems
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. :)
2 Posted by Ant on 10 Jul, 2011 04:43 PM
No replies? :(
Support Staff 3 Posted by Nick Quaranto on 23 Sep, 2011 03:12 PM
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/
4 Posted by ant on 23 Sep, 2011 05:14 PM
Thanks. So I need all of them installed? :( They hog a lot of disk space.
Support Staff 5 Posted by Nick Quaranto on 23 Sep, 2011 07:46 PM
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.
6 Posted by ant on 23 Sep, 2011 07:48 PM
I only use Ruby for Rbot as shown in http://ruby-rbot.org/ ...
Support Staff 7 Posted by Nick Quaranto on 12 Oct, 2011 01:56 PM
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).
Nick Quaranto closed this discussion on 12 Oct, 2011 01:56 PM.
Eric Hodel re-opened this discussion on 12 Oct, 2011 09:30 PM
Support Staff 8 Posted by Eric Hodel on 12 Oct, 2011 09:30 PM
Alternately, you can run
gem cleanupto get rid of old versions