Last Updated: February 25, 2016
·
12.07K
· Marko Klemetti

Default --no-ri --no-rdoc on Ruby Gem installation

If you want to speed up your gem installations and have less clutter in your system, remove the rdoc and ri when installing new gems.

Usually you would install a new gem like so:

gem install bundler --no-ri --no-rdoc

And if you want to default not having the documentation, add the flags to your global gemrc definition:

echo "gem: --no-ri --no-rdoc" > ~/.gemrc

And to knock it up a notch, you should add .gemrc to your dotfiles.

Here's mine for an example. They're a fork from the better known thoughtbot dotfiles.

2 Responses
Add your response

Hi,
good tip. In what way is this similar to having this on the .gemrc file?

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri

Thanks.

over 1 year ago ·

Careful with '>' as it'll clobber the in place file. Use '>>' for append

over 1 year ago ·