Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
380 views
in Technique[技术] by (71.8m points)

ruby - 如何将--no-ri --no-rdoc设置为gem install的默认设置?(How to make --no-ri --no-rdoc the default for gem install?)

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输出(我使用其他文档编制方式)。)

Every gem I install installs RI and RDoc documentation by default, because I forget to set --no-ri --no-rdoc .

(默认情况下,我安装的每个gem都会安装RI和RDoc文档,因为我忘记设置--no-ri --no-rdoc 。)

Is there a way to make those two flags the default?

(有没有办法将这两个标志设置为默认值?)

  ask by Ricardo Acras translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You just add following line to your local ~/.gemrc file (it is in your home folder)

(您只需~/.gemrc添加到本地~/.gemrc文件中(位于文件夹中))

gem: --no-document

or you can add this line to the global gemrc config file.

(或者您可以将此行添加到全局gemrc配置文件中。)

Here is how to find it (in Linux)

(这是找到它的方法(在Linux中))

strace gem source 2>&1 | grep gemrc

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...