snippetrubyCritical
How to make --no-ri --no-rdoc the default for gem install?
Viewed 0 times
rdochowinstallgemtheformakedefault
Problem
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).
Every gem I install installs RI and RDoc documentation by default, because I forget to set
Is there a way to make those two flags the default?
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?
Solution
You just add the following line to your local
by
or you can add this line to the global
Here is how to find it (in Linux):
The
~/.gemrc file (it is in your home folder):gem: --no-documentby
echo 'gem: --no-document' >> ~/.gemrcor you can add this line to the global
gemrc config file.Here is how to find it (in Linux):
strace gem source 2>&1 | grep gemrcThe
--no-document option is documented in the RubyGems CLI Reference.Code Snippets
gem: --no-documentecho 'gem: --no-document' >> ~/.gemrcstrace gem source 2>&1 | grep gemrcContext
Stack Overflow Q#1381725, score: 1306
Revisions (0)
No revisions yet.