如何使 --no-ri --no-rdoc 成为 gem 安装的默认值? [英] How to make --no-ri --no-rdoc the default for gem install?
问题描述
我不使用安装在我的机器或我处理的服务器中的 gem 的 RI 或 RDoc 输出(我使用其他文档方式).
I don't use the RI or RDoc output from the gems I install in my machine or in the servers I handle (I use other means of documentation).
我安装的每个 gem 都会默认安装 RI 和 RDoc 文档,因为我忘记设置 --no-ri --no-rdoc
.
Every gem I install installs RI and RDoc documentation by default, because I forget to set --no-ri --no-rdoc
.
有没有办法让这两个标志成为默认标志?
Is there a way to make those two flags the default?
推荐答案
您只需将以下行添加到您本地的 ~/.gemrc
文件(它在您的 home 文件夹):
You just add the following line to your local ~/.gemrc
file (it is in your home folder):
gem: --no-document
由
echo 'gem: --no-document' >> ~/.gemrc
或者您可以将此行添加到全局 gemrc
配置文件中.
or you can add this line to the global gemrc
config file.
这里是如何找到它(在 Linux 中):
Here is how to find it (in Linux):
strace gem source 2>&1 | grep gemrc
--no-document
选项记录在 RubyGems CLI 参考.
这篇关于如何使 --no-ri --no-rdoc 成为 gem 安装的默认值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!