2013-03-03 42 views
4

以前设置我的系统来禁止使用--no-ri--no-rdoc来安装gem文档。如何防止使用gem v 2.0自动安装宝石文档

Ruby 2.0.0和gem 2.0.0似乎已经删除了--no-ri标志(和功能?)。

即使指定--no-rdoc的时候,我仍然得到installing documentation

~/dev/ruby> gem install bundler --no-rdoc 
Fetching: bundler-1.3.1.gem (100%) 
Successfully installed bundler-1.3.1 
Done installing documentation for bundler (0 sec). 

如何看是否被安装的文档?如果安装了,如何禁止所有的gem安装?

回答

13

由于gem help install状态:

 
Usage: gem install GEMNAME [GEMNAME ...] [options] -- --build-flags [options] 
... 
    Install/Update Options: 
    ... 
     --[no-]document [TYPES]  Generate documentation for installed gems 
            List the documentation types you wish to 
            generate. For example: rdoc,ri 
    -N, --no-document    Disable documentation generation 

总之:现在

  • --no-rdoc--no-document rdoc

  • --no-ri现在是--no-document ri

  • 您可以防止使用--no-document-N进行安装。

(不幸的是在写本书的documentation on Rubygems.org目前外的日期,所以忽略了现在。)