我需要释放本地计算机上的磁盘空间,这几乎已分配到我的Ruby版本管理器(RVM)目录中。
现在,我似乎只有一个红宝石版本(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$
但我的RVM目录,还有许多其他无关的目录/版本:
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$
除了“ruby-1.9.2-p136”和“ruby-1.9.2-p136@global”dirs(ruby-1.9.2-p136@greendog *老了)之外,还可以删除剩下的所有目录rvm系统“什么都不返回”?我会使用“rm”命令,还是有RVM体现的命令来清理更好的方法?是否可以清理缓存目录?
提前致谢。 卢卡
答案 0 :(得分:18)
我认为rvm cleanup
可以做到这一点。
除此之外我没有看到任何理由删除RVM中的实际gem目录,如果它们不再与RVM相关联。
如果environments
中不存在匹配条目,则可以安全删除随附的gem目录。正如RVM能够使用的其他内容一样。
答案 1 :(得分:2)
...事实证明,之前的一些未使用的引用只是gemsets:
rvm gemset list
lsoave@ubuntu:~$ rvm gemset list
gemsets for ruby-1.9.2-p136 (found in /home/lsoave/.rvm/gems/ruby-1.9.2-p136)
global
greendog
greendog2
greendog99
lsoave@ubuntu:~$
我删除了如下:
lsoave@ubuntu:~$ rvm gemset delete greendog99
Are you SURE you wish to remove the entire gemset directory 'greendog99' (/home/lsoave/.rvm/gems/ruby-1.9.2-p136@greendog99)?
(anything other than 'yes' will cancel) > yes
lsoave@ubuntu:~$ rvm gemset delete greendog2
Are you SURE you wish to remove the entire gemset directory 'greendog2' (/home/lsoave/.rvm/gems/ruby-1.9.2-p136@greendog2)?
(anything other than 'yes' will cancel) > yes
lsoave@ubuntu:~$ rvm gemset delete greendog
Are you SURE you wish to remove the entire gemset directory 'greendog' (/home/lsoave/.rvm/gems/ruby-1.9.2-p136@greendog)?
(anything other than 'yes' will cancel) > yes
lsoave@ubuntu:~$
比备份旧的'lib'之一(以防万一......):
lsoave@ubuntu:~/.rvm/gems$ tar zcvf ruby-1.8.7-p302.gz ./ruby-1.8.7-p302
并使用stuartc:
删除了相关目录,作为之前的评论lsoave@ubuntu:~/.rvm/gems$ rm -rf ./ruby-1.8.7-p302
现在回去工作了。
我会等几天,寻找一切都是对的......