We're working on something new! Hook Relay gives you Stripe-quality webhooks in minutes. Sign up for free today! Check out Hook Relay

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. :)

Honeybadger has your back when it counts. We're the only error tracker that combines exception monitoring, uptime monitoring, and cron monitoring into a single, simple to use platform.

Our mission: to tame production and make you a better, more productive developer. Learn more

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.