# How to generate local API documentation?

**URL:** <https://www.ruby-forum.com/t/how-to-generate-local-api-documentation/107070>\
**Category:** Ruby\
**Created:** [June 17, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/how-to-generate-local-api-documentation/107070 "2007-06-17T18:37:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stephan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@stephan](https://www.ruby-forum.com/u/stephan)\
**Post date:** [June 17, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/how-to-generate-local-api-documentation/107070/1 "2007-06-17T18:37:53Z")

</div>

Hi all.

I’m fairly new to Ruby and I’m trying to generate a local copy of the  
docs for the core and standard API, as shown online at

> **[Ruby-Doc.org: Documenting the Ruby Language](https://ruby-doc.org/)**
>
> Fast, searchable Ruby documentation for core and standard libraries. Plus, links to tutorials, guides, books, and related sites.

I ran rdoc in my ruby installation directory (/usr/lib/ruby) but it ate  
all my memory so I had to kill it.

Next, I ran rdoc in /usr/lib/ruby/1.8, which worked but produced  
documentation that doesn’t contain details of certain parts of the  
language. For example, searching for “kind\_of” reveals that the  
assert\_kind\_of (Test::Unit::Assertions) method is documented, but the  
kind\_of? (Object) method isn’t.

How can I generate local documentation?

Many thanks.

Steph

P.S. Note that I installed ruby with a doc use flag, so ri works  
properly, but I couldn’t find any html documentation on my system.

---

<div class="post-metadata">

**Author:** ![stephan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@stephan](https://www.ruby-forum.com/u/stephan)\
**Post date:** [June 18, 2007, 11:10am UTC](https://www.ruby-forum.com/t/how-to-generate-local-api-documentation/107070/2 "2007-06-18T11:10:17Z")

</div>

Well I’ve found out why I can’t generate core API docs using rdoc -  
because Ruby is installed as a .so library, hence there are no .rb or .c  
for rdoc to parse.

I’ve downloaded the documentation from  
[Ruby-Doc.org: Documenting the Ruby Language](http://www.ruby-doc.org/downloads/) but the ruby version is not exactly  
the same as the one I’ve got installed, which could obviously lead to  
problems in the future.

Does anyone know whether there’s any way I can generate html  
documentation from the ri docs or the .so libraries?

---

<div class="post-metadata">

**Author:** ![stephan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@stephan](https://www.ruby-forum.com/u/stephan)\
**Post date:** [June 18, 2007, 11:27am UTC](https://www.ruby-forum.com/t/how-to-generate-local-api-documentation/107070/3 "2007-06-18T11:27:30Z")

</div>

On 6/18/07, Stephan D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> documentation from the ri docs or the .so libraries?  
> Download source package (either one for your distribution or the  
> “upstream” source tar from [ruby-lang.org](http://ruby-lang.org)). Unpack anywhere (e.g. you  
> home dir, /usr/src, /tmp,…). From the top directory (where all the  
> .c and .h files are located) run rdoc -o output\_path, or add more  
> arguments to finetune the output. When it’s finished, you will have  
> the docs in output\_path. The -o argument is important, because rdoc by  
> default creates directory “doc” but here the one is already created,  
> so you have to point rdoc to some other place.

J.

---

<div class="post-metadata">

**Author:** ![stephan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8baadc/32.png) [@stephan](https://www.ruby-forum.com/u/stephan)\
**Post date:** [June 18, 2007, 12:14pm UTC](https://www.ruby-forum.com/t/how-to-generate-local-api-documentation/107070/4 "2007-06-18T12:14:38Z")

</div>

Thank you Jano, that worked a treat!
