RVM/rbenv 不看不知道,RVM 占了这么多空间

huacnlee · 2012年06月13日 · 最后由 cdredfox 回复于 2012年07月14日 · 4896 次阅读
jason-imac ~ » rvm disk-usage all                                                                          
   Downloaded Archives Usage: 64M
          Repositories Usage: 148M
 Extracted Source Code Usage: 519M
             Log Files Usage: 3.4M
              Packages Usage: 1.9M
                Rubies Usage: 185M
               Gemsets Usage: 3.5G
              Wrappers Usage: 228K
       Temporary Files Usage: 0B
           Other Files Usage: 4.0M
            Total Disk Usage: 4.4G

没有默认设置 no-ri, no-rdoc 吧?可以将/home/xxuser/.rvm/gems/ruby-1.9.3-pxxx/doc 这个目录删除掉,这样可以少占空间

Gemsets Usage: 3.5G 这么大 汗

~Gemsets Usage: 3.5G 这么大 汗~

#1 楼 @quakewang 有设置那个的 应该是 ruby 版本太多了 1.9.3 都是 3 个,里面有多余的 Gem 文件

我的更夸张

 Downloaded Archives Usage: 135M
         Repositories Usage: 0B
Extracted Source Code Usage: 389M
            Log Files Usage: 1000K
             Packages Usage: 612K
               Rubies Usage: 251M
              Gemsets Usage: 4.2G
             Wrappers Usage: 324K
      Temporary Files Usage: 40K
          Other Files Usage: 4.1M
           Total Disk Usage: 5.0G

-.-!

rvm gemset globalcache enable

应该还是有用的,共享 gem cache~

吓了一跳

Downloaded Archives Usage: 69M
Repositories Usage: 111M
Extracted Source Code Usage: 1.2G
Log Files Usage: 1.9M
Packages Usage: 600K
Rubies Usage: 453M
Gemsets Usage: 6.6G
Total Disk Usage: 8.4G

话说你们的输出怎么这么整齐

所以我在开发机上每隔一段时间就清理一下 gemset 和多余的 gem

➜  ~ rbenv disk-usage
*** Ruby Versions ***
934M    /Users/linjunpop/.rbenv/versions/1.9.3-p194
 38M    /Users/linjunpop/.rbenv/versions/rbx-1.2.4
 54M    /Users/linjunpop/.rbenv/versions/ree-1.8.7-2012.02

最近重装了系统,比较小。 相对来说,好几个项目的 test log 都超过 5G 了。囧

可以用 gem cleanup 清理一些旧版本

我一般不爽的时候就会重新安装 rvm,然后对最近的项目进行 bundle,旧项目用的时候再说

我得好像非常干净:

~ $ rvm disk-usage all
   Downloaded Archives Usage: 11M
          Repositories Usage: 0B
 Extracted Source Code Usage: 125M
             Log Files Usage: 296K
              Packages Usage: 616K
                Rubies Usage: 28M
               Gemsets Usage: 408M
              Wrappers Usage: 100K
       Temporary Files Usage: 0B
           Other Files Usage: 3.8M
            Total Disk Usage: 577M

rvm disk-usage all  
   Downloaded Archives Usage: 33M
          Repositories Usage: 0B
 Extracted Source Code Usage: 487M
             Log Files Usage: 496K
              Packages Usage: 1.2M
                Rubies Usage: 168M
               Gemsets Usage: 2.5G
              Wrappers Usage: 404K
       Temporary Files Usage: 4.0K
           Other Files Usage: 4.1M
            Total Disk Usage: 3.2G

这....真不知道这么大,平时也没有几个 gem 啊,就算有,那一个 gem 都是代码,能有几大?怎么占这么多

  Downloaded Archives Usage: 15M
         Repositories Usage: 0B
Extracted Source Code Usage: 194M
            Log Files Usage: 292K
             Packages Usage: 920K
               Rubies Usage: 52M
              Gemsets Usage: 257M
             Wrappers Usage: 148K
      Temporary Files Usage: 4.0K
          Other Files Usage: 3.9M
           Total Disk Usage: 522M

看来我的是最小的~

Downloaded Archives Usage: 20M Repositories Usage: 0B Extracted Source Code Usage: 234M Log Files Usage: 944K Packages Usage: 600K Rubies Usage: 52M Gemsets Usage: 906M Wrappers Usage: 100K Temporary Files Usage: 0B Other Files Usage: 3.0M Total Disk Usage: 1.2G

$ gem cleanup

Gemsets Usage: 622M

Downloaded Archives Usage: 12M Repositories Usage: 0B Extracted Source Code Usage: 153M Log Files Usage: 132K Packages Usage: 904K Rubies Usage: 40M Gemsets Usage: 249M Wrappers Usage: 76K Temporary Files Usage: 4.0K Other Files Usage: 3.9M Total Disk Usage: 457M 嘿嘿,我最少呀。

匿名 #17 2012年07月14日

Downloaded Archives Usage: 19M Repositories Usage: 128M Extracted Source Code Usage: 441M Log Files Usage: 688K Packages Usage: 12M Rubies Usage: 44M Gemsets Usage: 156M Wrappers Usage: 148K Temporary Files Usage: 4.0K Other Files Usage: 4.1M Total Disk Usage: 804M

Downloaded Archives Usage: 212M Repositories Usage: 103M Extracted Source Code Usage: 1.3G Log Files Usage: 3.8M Packages Usage: 616K Rubies Usage: 735M Gemsets Usage: 6.2G Wrappers Usage: 1.4M Temporary Files Usage: 256K Other Files Usage: 4.3M Total Disk Usage: 8.6G

  Downloaded Archives Usage: 16M
         Repositories Usage: 0B
Extracted Source Code Usage: 176M
            Log Files Usage: 156K
             Packages Usage: 2.4M
               Rubies Usage: 44M
              Gemsets Usage: 725M
             Wrappers Usage: 112K
      Temporary Files Usage: 4.0K
          Other Files Usage: 4.1M
           Total Disk Usage: 966M

rvm disk-usage all Downloaded Archives Usage: 41M Repositories Usage: 0B Extracted Source Code Usage: 170M Log Files Usage: 452K Packages Usage: 2.6M Rubies Usage: 43M Gemsets Usage: 413M Wrappers Usage: 116K Temporary Files Usage: 4.0K Other Files Usage: 4.2M Total Disk Usage: 674M

我就是因为 gemset 太占空间了才换的 rbenv

➜  ~  rvm disk-usage all
   Downloaded Archives Usage: 9.9M
          Repositories Usage: 0B
 Extracted Source Code Usage: 112M
             Log Files Usage: 444K
              Packages Usage: 616K
                Rubies Usage: 24M
               Gemsets Usage: 1.1G
              Wrappers Usage: 36K
       Temporary Files Usage: 0B
           Other Files Usage: 2.2M
            Total Disk Usage: 1.3G
需要 登录 后方可回复, 如果你还没有账号请 注册新账号