Nuclear Rooster

6Dec/090

Skipping gem documentation: configure .gemrc to speed up gem installation

The .gemrc file can specify default options for the 'gem' executable, and since I haven't ever looked up ri or rdoc on my local system, I decided to turn these off by default. I've been adding the '--no-ri' and '--no-rdoc' flags for a while, but my laziness just got the better of me.

Turning of the RI and Rdoc documentation speeds up gem installs. Here, installing capistrano without docs takes about 11 seconds, whereas installing the documenation more than doubles the time to about 24 seconds.

nicks-computer-3:snap nick$ time sudo gem install capistrano --no-ri --no-rdoc
Successfully installed capistrano-2.5.10
1 gem installed

real	0m11.480s
user	0m7.262s
sys	0m0.374s
nicks-computer-3:snap nick$ time sudo gem install capistrano --ri --rdoc
Successfully installed capistrano-2.5.10
1 gem installed
Installing ri documentation for capistrano-2.5.10...
Installing RDoc documentation for capistrano-2.5.10...

real	0m23.974s
user	0m18.956s
sys	0m0.706s

If you want to turn off the documentation options, add this line to your ~/.gemrc file:

gem: --no-ri --no-rdoc

So that it looks something like this:

nicks-computer-3:snap nick$ cat ~/.gemrc
---
:bulk_threshold: 1000
:backtrace: false
gemcutter_key: XXXXX
gem: --no-ri --no-rdoc
:benchmark: false
:verbose: true
:update_sources: true
:sources:
- http://gems.rubyforge.org/
- http://gems.opscode.com
Filed under: ruby Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.