I need to free disk space on my local machine, which is almost allocated into my Ruby Version Manager (RVM) dir.
Now, it seems I got just one ruby version ( 1.9.2p136 ) :
lsoave@ubuntu:~/rails/github/gitwatcher$ ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [i686-linux]
lsoave@ubuntu:~/rails/github/gitwatcher$
lsoave@ubuntu:~/rails/github/gitwatcher$ rvm list
rvm rubies
=> ruby-1.9.2-p136 [ i386 ]
lsoave@ubuntu:~/rails/github/gitwatcher$
lsoave@ubuntu:~/rails/github/gitwatcher$ which ruby
/home/lsoave/.rvm/rubies/ruby-1.9.2-p136/bin/ruby
lsoave@ubuntu:~/rails/github/gitwatcher$
but my RVM dir, have many others unrelated dirs/versions :
lsoave@ubuntu:~/rails/github/gitwatcher$ ls -la ~/.rvm/gems
total 72
drwxr-xr-x 18 lsoave lsoave 4096 2011-05-21 15:44 .
drwxr-xr-x 23 lsoave lsoave 4096 2011-02-10 22:46 ..
drwxr-xr-x 2 lsoave lsoave 4096 2010-08-29 19:50 cache
drwxr-xr-x 2 lsoave lsoave 4096 2010-08-31 21:50 jruby-1.3.7
drwxr-xr-x 2 lsoave lsoave 4096 2010-08-31 21:50 jruby-1.3.8
drwxr-xr-x 2 lsoave lsoave 4096 2011-05-21 15:44 ree-1.8.7-2010.02
drwxr-xr-x 8 lsoave lsoave 4096 2010-09-08 11:25 ruby-1.8.7-p302
drwxr-xr-x 7 lsoave lsoave 4096 2010-08-29 22:00 ruby-1.8.7-p302@global
drwxr-xr-x 7 lsoave lsoave 4096 2010-08-29 22:24 ruby-1.9.2-head
drwxr-xr-x 7 lsoave lsoave 4096 2010-08-29 22:24 ruby-1.9.2-head@global
drwxr-xr-x 8 lsoave lsoave 4096 2010-08-31 23:47 ruby-1.9.2-p0
drwxr-xr-x 7 lsoave lsoave 4096 2010-08-29 19:50 ruby-1.9.2-p0@global
drwxr-xr-x 8 lsoave lsoave 4096 2011-02-10 19:44 ruby-1.9.2-p136
drwxr-xr-x 7 lsoave lsoave 4096 2011-02-10 19:23 ruby-1.9.2-p136@global
drwxr-xr-x 7 lsoave lsoave 4096 2011-04-08 21:21 ruby-1.9.2-p136@greendog
drwxr-xr-x 7 lsoave lsoave 4096 2011-04-09 00:57 ruby-1.9.2-p136@greendog2
drwxr-xr-x 7 lsoave lsoave 4096 2011-02-15 00:09 ruby-1.9.2-p136@greendog99
drwxr-xr-x 2 lsoave lsoave 4096 2011-02-10 19:04 system
lsoave@ubuntu:~/rails/github/gitwatcher$
is it save to remove all dirs remaining with just “ruby-1.9.2-p136” and “ruby-1.9.2-p136@global” dirs (ruby-1.9.2-p136@greendog* are old and “rvm system” return nothing) ? Will I use “rm” command, or are there RVM embodied commands to cleanup a better way ? Is it possible cleanup the cache dir ?
Thanks in advance.
luca
I suppose
rvm cleanupcould do the trick.Other than that I don’t see any reason that deleting the actual gem directories inside RVM if they aren’t associated with RVM any more.
If the matching entry doesn’t exist in
environmentsthen it is safe to delete the accompanying gem dir. As nothing else points to it that RVM would be able to use.