Skip to content

Instantly share code, notes, and snippets.

@mingsai
Created May 28, 2020 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingsai/1761f6993f50d3ff88abaed3e30d3dee to your computer and use it in GitHub Desktop.
Save mingsai/1761f6993f50d3ff88abaed3e30d3dee to your computer and use it in GitHub Desktop.
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. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment