Answer: Turn off ri and rdoc installation. Sure, you can do this on the commandline, like so:
sudo gem install fastercsv --no-ri --no-rdoc
Better, though, is to set this up as the default in your ~/.gemrc file.
--- :verbose: true :sources: - http://gems.rubyforge.org/ - http://gems.github.com/ :update_sources: true :backtrace: false :bulk_threshold: 1000 :benchmark: false gem: --no-ri --no-rdoc
Just add that last line and your gem installations will complete in no time.
February 14, 2009 at 7:56 pm
I’ve heard this tip before and noticed that it makes a huge difference.
But why are they so slow? Don’t ri and rdoc essentially just read in some Ruby files and then output a small amount of text?
February 28, 2009 at 6:22 am
Thanks for the tip, ive been using gemi as alias for sudo gem install –no-ri –nor-rdoc, but when installing my own gems via rake install this did not work .
March 1, 2009 at 7:46 pm
Awesome. Was getting really tired of constantly adding these options every time.
March 2, 2009 at 6:35 pm
Since gem installs also require sudo, I just threw this into my ~/.bashrc to take care of it all with one alias:
alias gemi=”sudo gem install –no-ri –no-rdoc”
then I can simply do:
gemi hpricot
March 2, 2009 at 6:59 pm
But, but, but… I like my local rdoc’s!
I autostart gem server whenever I boot my pc!
March 3, 2009 at 6:02 pm
No rdoc I can understand, but no ri is a bit crazy. Why should you need to use a browser to look up methods? What if you’re offline?
March 3, 2009 at 10:04 pm
I don’t mind waiting a bit when it installs, as long as I have as much info as I can offline.
having rdoc is handy, because it also contains the source code of the gem.
imo speeding up gem install is a bit of a non-issue.
March 4, 2009 at 8:39 pm
[...] Dainton, a developer at FiveRuns, demonstrates “how to speed up gem installs 10x.” I don’t buy that it’s ten times faster, but disabling the generation of ri and rdoc documents does [...]
March 4, 2009 at 9:34 pm
Iain, certainly you don’t need the documentation on a production server, and when you need to replace a production server quickly, things like this really do matter.
March 4, 2009 at 9:36 pm
Piggy-backing off the last comment — keep in mind there are two completely different environments to deal with. Sure, in development you want docs. But in production, why?
March 4, 2009 at 9:38 pm
That is certainly true. Although I try to include as much gems in my project as possible anyway.
March 5, 2009 at 3:03 pm
[...] Dainton, um desenvolvedor da FiveRuns, demonstra “como instalar um gem 10x mais rápido”. Eu não creio que seja 10 vezes mais rápido, mas desabilitando a geração dos documentos de [...]
March 5, 2009 at 4:47 pm
[...] original por Brian Danton, desenvolvedor da FiveRuns, aqui, e comentários no Ruby Inside, por Peter Cooper, [...]
March 6, 2009 at 11:10 am
I believe -d has the same effect
March 7, 2009 at 5:28 pm
[...] How to speed up gem installs 10x « The Budding Rubyist [...]
March 8, 2009 at 9:25 am
Wow, that’s what we always do on production server.
March 8, 2009 at 11:42 pm
Is there a way to install the gems in haste and then install documentation at leisure?
March 20, 2009 at 2:52 am
It turns out you can install the documentation at leisure using gem rdoc, as mentioned in this stack overflow question.
March 21, 2009 at 4:25 pm
Perhaps on solaris this could make a huge diff. I’ve had major problems installing gems in a timely fashion on a solaris 10 box on a t1000… to my recollection in large part due to rdoc.
March 23, 2009 at 1:22 am
[...] Como já era de se esperar, o RubyGems também já vem configurado. Note que que utilizei –no-ri e –no-rdoc, excluindo o download da documentação. Assim, a gem pode ser instalada até 10x mais rápida. [...]
March 28, 2009 at 8:45 pm
[...] How to speed up gem installs 10x « The Budding Rubyist [...]
June 23, 2009 at 2:21 am
[...] Digest, 6-22-09 Posted by Weekly Digest in Weekly Digest on June 22, 2009 0 Comments How to speed up gem installs 10x Answer: Turn off ri and rdoc [...]