# Ri, rdoc, gems, and the ruby\_site directory

**URL:** <https://www.ruby-forum.com/t/ri-rdoc-gems-and-the-ruby-site-directory/62289>\
**Category:** Ruby\
**Created:** [June 2, 2006, 9:54am UTC](https://www.ruby-forum.com/t/ri-rdoc-gems-and-the-ruby-site-directory/62289 "2006-06-02T09:54:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [June 2, 2006, 9:54am UTC](https://www.ruby-forum.com/t/ri-rdoc-gems-and-the-ruby-site-directory/62289/1 "2006-06-02T09:54:33Z")

</div>

I’m on Debian GNU/Linux, but installed from source to my /opt  
directory (–prefix=/opt/ruby-1.8.4).

- If I write some modules and want everyone at the site to be able to  
access them, should I copy them to  
/opt/ruby-1.8.4/lib/ruby/site\_ruby/1.8 ?

- After I’ve got those site-wide modules in-place, I want to make  
their docs available to everyone via the ri command. Can I then just  
do:

cd /opt/ruby-1.8.4/lib/ruby/site\_ruby/1.8  
rdoc --ri-site

?

- My guess is, rdoc will ripple down through everything in that dir  
and below (including the rubygems directory I figure) looking for .rb  
(or .c) files and creating .yaml files from them. If that’s the case,  
where do the resulting .yaml files end up?

- Now, as for using RubyGems, it looks like when I install gems, some  
docs for them get installed automatically (so, I don’t need to  
manually run “gem rdoc” I suppose). For rake, for example, these docs  
are all html files in  
/opt/ruby-1.8.4/lib/ruby/gems/1.8/doc/rake-0.7.1. But I’m guessing  
that many gems have docs in them that I’d like to read using ri. For  
those:

\*\* How do I generate the yaml files for those gems’ files? (maybe cd  
to /opt/ruby-1.8.4/lib/ruby/gems/1.8/gems and run “rdoc --ri-foo”?)

\*\* Where would the yaml files (corresponding to the gems’ source  
files) end up? (maybe in some new  
/opt/ruby-1.8.4/lib/ruby/site\_ruby/ri directory? Hm…)

I’m trying to write up a doc on this whole affair that might be useful  
to others. Tonight’s very rough first cut is here:  
[http://www.simisen.com/jmg/temp/ri\_rdoc.html](http://www.simisen.com/jmg/temp/ri_rdoc.html)

Thanks,  
—John

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [June 2, 2006, 10:06am UTC](https://www.ruby-forum.com/t/ri-rdoc-gems-and-the-ruby-site-directory/62289/2 "2006-06-02T10:06:51Z")

</div>

On 6/2/06, John G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [snip]

Whoops. Typo:

message\_subj.sub( /ruby\_site/, “site\_ruby” )

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [June 2, 2006, 8:59pm UTC](https://www.ruby-forum.com/t/ri-rdoc-gems-and-the-ruby-site-directory/62289/3 "2006-06-02T20:59:55Z")

</div>

On 6/2/06, John G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [snip]
> 
> \*\* How do I generate the yaml files for those gems’ files? (maybe cd  
> to /opt/ruby-1.8.4/lib/ruby/gems/1.8/gems and run “rdoc --ri-foo”?)
> 
> \*\* Where would the yaml files (corresponding to the gems’ source  
> files) end up? (maybe in some new  
> /opt/ruby-1.8.4/lib/ruby/site\_ruby/ri directory? Hm…)

Hmm… “message “Re: [PATCH] Rubygems/ri integration””:  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7423](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7423)  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7426](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7426)  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7479](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/7479)

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [June 4, 2006, 11:03pm UTC](https://www.ruby-forum.com/t/ri-rdoc-gems-and-the-ruby-site-directory/62289/4 "2006-06-04T23:03:56Z")

</div>

On 6/2/06, I wrote:

> I’m on Debian GNU/Linux, but installed from source to my /opt  
> directory (–prefix=/opt/ruby-1.8.4).
> 
> [snip a bunch of questions]

Ok, I figured out some of the details, and got help on the RubyGems ML  
for others. I put up what I’ve learned here:

[http://wiki.rubygarden.org/Ruby/page/show/RiRDocAndGems](http://wiki.rubygarden.org/Ruby/page/show/RiRDocAndGems)

—John

---

<div class="post-metadata">

**Author:** ![softf5ajivanet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/9f8e36/32.png) [@softf5ajivanet](https://www.ruby-forum.com/u/softf5ajivanet)\
**Post date:** [June 5, 2006, 11:40pm UTC](https://www.ruby-forum.com/t/ri-rdoc-gems-and-the-ruby-site-directory/62289/5 "2006-06-05T23:40:09Z")

</div>

Thanks! I’ve been needing that…  
:\_)
