Every time I install Rails, I kick myself for forgetting to add the --no-ri and --no-rdoc flags like this:

gem install rails -v 5.2.0 --no-ri --no-rdoc

This results in a lot of documentation being installed, which takes a while. And frankly, I’m offline so rarely while working, that I really don’t need access to offline documentation.

Today I decided to make this “no docs” setting global by adding gem: --no-document to my .gemrc file. Here’s how.

Open the .gemrc File

To open your .gemrc file in your default text editor, type this into the command line:

open ~/.gemrc

You’ll see something like this:

---
:backtrace: false
:bulk_threshold: 1000
:sources:
- http://rubygems.org
:update_sources: true
:verbose: true

Insert the Setting

Then insert gem: --no-document to the top of the file like this:

---
gem: --no-document
:backtrace: false
:bulk_threshold: 1000
:sources:
- http://rubygems.org
:update_sources: true
:verbose: true

Save & Close

Save, close, and voila, it worked for me. My next Rails install skipped the documentation.