April 1, 2013

How to turn off ri and rdoc installation

Most often we never refer to ri and rdoc for all the gems installed on our system.
Sometimes duplicate ri and rdoc are installed on our system when we use ruby version manager (rvm). These documentation takes up few MB of your harddisk. Even space is not a BIG issue.
These ri and rdoc took considerable time while installation. We can increase gem installation time 8x by turning off the ri and rdoc installation.
Turn off ri and rdoc installation. Sure, you can do this on the command-line, like so:

sudo gem install haml --no-ri --no-rdoc

If, like me and most developers, you would rather read the documentation online and have your gems install quickly, then you can disable the documentation generation by creating a file called ".gemrc" in your user's home directory

Better, though, is to set this up as the default in your ~/.gemrc file.

:verbose: true
:update_sources: true
:backtrace: false
:bulk_threshold: 1000
:benchmark: false
gem: --no-ri --no-rdoc
Post a Comment