13

Rubyinside mentioned a blog post on how to speed up gem installation by not installing RI or RDoc.

Is it possible to install a gem and subsequently install documentation at a later date, so you can hack in haste and RTFM at leisure?

Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338

2 Answers2

20
> gem help rdoc

Usage: gem rdoc [args] [options]
Options:
      --all                        Generate RDoc/RI documentation for all
                                   installed gems
      --[no-]rdoc                  Include RDoc generated documents
      --[no-]ri                    Include RI generated documents
  -v, --version VERSION            Specify version of gem to rdoc
Arguments:
  GEMNAME       gem to generate documentation for (unless --all)
Summary:
  Generates RDoc for pre-installed gems
Defaults:
  --version '>= 0' --rdoc --ri
Jeff Dallien
  • 4,491
  • 3
  • 22
  • 19
  • How about modifying the documentation of an already installed gem? My question is here http://stackoverflow.com/questions/5776491/generating-rdocs-for-locally-installed-gems – Igbanam Apr 26 '11 at 05:50
10

If you run gem rdoc --all it will generate documentation for all your gems.

You can also use the following command to generate docs for gems in your bundle:

bundle list | egrep '\*' | sed -e 's/* \(.*\) (.*)/\1/g' | xargs -n 1 gem rdoc

You may need to adapt to your needs and also if bundle changes its output format.

simao
  • 14,491
  • 9
  • 55
  • 66
  • Thanks simao, I am getting too much information, so now I find myself running `bundle list | egrep '\*' | sed -e 's/* \(.*\) (.*)/\1/g' | xargs -n 1 gem rdoc --no-ri 2>&1 | grep -v "Gem::SourceIndex"` – kbrock Jan 20 '14 at 20:36