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 --no-ri --no-rdoc
.
Is there a way to make those two flags the default?
You just add following line to your local
~/.gemrc
file (it is in your home folder)or you can add this line to the global gemrc config file. Here is how to find it (in Linux)
Note that
--no-ri
and--no-rdoc
have been deprecated according to the new guides. The recommended way is to use--no-document
in~/.gemrc
or/etc/gemrc
.or
From RVM’s documentation:
Note: The original answer was:
This is no longer valid; the RVM docs have since been updated, thus the current answer to only include the
gem
directive is the correct one.# /home/{user}/.gemrc
http://webonrails.com/2008/12/03/skiping-installation-of-ri-and-rdoc-documentation-while-installing-gems/
On Windows7 the .gemrc file is not present, you can let Ruby create one like this (it's not easy to do this in explorer).
You will have to confirm (it's unsafe). Now the file is created in your userprofile folder (c:\users\)
You can edit the textfile to remove the source you added or you can remove it with
On Linux (and probably Mac):
This one-liner used to be in comments here, but somehow disappeared.