How to globally disable rdoc and ri during gem installs

Learn how to globally disable rdoc and ri during gem installs to help speed things up.

Gem installs can be slooow. One of the biggest culprits is documentation. Every time you install a gem, your computer has to scan the source of that gem and generate documentation.

This can be useful if you often need to check gem documentation when you're offline. Just run  gem server and point your browser at http://localhost:8808 to access them. The ri command is also handy to search documentation from the terminal.

But if you're like me, you probably don't use local docs. You probably have a decent internet connection at most times. So the time spent generating documentation is just time wasted.

If you're using bundler to install all of your gems, you don't have to do anything. Bundler skips rdoc/ri by default. If you happen to be using the gem command directly, you'll need to do a bit of configuration.

You may already know that you can disable rdoc/ri generation when you run gem install, by passing in certain flags.

gem install honeybadger --no-rdoc --no-ri  # The old, deprecated way
gem install honeybadger --no-document      # The new way

You can also tell rubygems to apply these flags as defaults. Just add the following line to your ~/.gemrc file:

gem: --no-document

But what if you're planning a camping trip and need to grab the local documentation? It's no problem to generate it yourself.

gem rdoc --all --overwrite # regen all docs
gem rdoc honeybadger # generate docs for one gem

Be careful if you choose to regen all your docs, though. It might take a while. :)

What to do next:
  1. Try Honeybadger for FREE
    Honeybadger helps you find and fix errors before your users can even report them. Get set up in minutes and check monitoring off your to-do list.
    Start free trial
    Easy 5-minute setup — No credit card required
  2. Get the Honeybadger newsletter
    Each month we share news, best practices, and stories from the DevOps & monitoring community—exclusively for developers like you.
    author photo

    Starr Horne

    Starr Horne is a Rubyist and Chief JavaScripter at Honeybadger.io. When she's not neck-deep in other people's bugs, she enjoys making furniture with traditional hand-tools, reading history and brewing beer in her garage in Seattle.

    More articles by Starr Horne