# How to use ri with a new package

**URL:** <https://www.ruby-forum.com/t/how-to-use-ri-with-a-new-package/118132>\
**Category:** Ruby\
**Created:** [October 24, 2007, 4:40am UTC](https://www.ruby-forum.com/t/how-to-use-ri-with-a-new-package/118132 "2007-10-24T04:40:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [October 24, 2007, 4:40am UTC](https://www.ruby-forum.com/t/how-to-use-ri-with-a-new-package/118132/1 "2007-10-24T04:40:43Z")

</div>

Hi All,

I just used gem to install the package “sys-admin” from the RubyForge  
sysadmin project by Daniel B… The example that Daniel provided  
for using sys-admin worked fine.

I’d like to use ri to display the RDoc documentation, but I can’t  
figure out how.

The package is installed at K:\_Utilities\Ruby\_1.8.2-15\ruby\lib\ruby  
\gems\1.8\doc\sys-admin-1.4.2-mswin32.  
The rdoc subdirectory had files like fr\_???\_index.html for ??? =  
class, file, method. Double-clicking them does produce RDoc-style  
documentation. But how can I use ri to bring up that documentation  
without resorting to Windows Explorer?

## I tried a few other things to no avail. The following ri command produces documentation of the “class” method of the class Object, not a list of classes of the sys-admin package: K:\_Utilities\Ruby\_1.8.2-15\ruby\lib\ruby\gems\1.8\doc\sys-admin-1.4.2- mswin32\rdoc\>ri class

## Object#class obj.class =\> class

```
 Returns the class of _obj_, now preferred over +Object#type+, as

```

an  
object’s type in Ruby is only loosely tied to that object’s  
class.  
This method must always be called with an explicit receiver, as  
+class+ is also a reserved word in Ruby.

```
    1.class #=> Fixnum
    self.class #=> Object

```

I thought “ri index” might do it, but instead I got:  
K:\_Utilities\Ruby\_1.8.2-15\ruby\lib\ruby\gems\1.8\doc\sys-admin-1.4.2-  
mswin32\rdoc\>ri index  
More than one method matched your request. You can refine  
your search by asking for information on one of:

```
 Array#each_index, Array#index, Array#indexes, Array#rindex,
 Enumerable#each_with_index, Generator#index, Hash#index,
 Hash#indexes, String#index, String#rindex

```

Thanks in advance,  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [October 24, 2007, 6:31am UTC](https://www.ruby-forum.com/t/how-to-use-ri-with-a-new-package/118132/2 "2007-10-24T06:31:38Z")

</div>

RichardOnRails wrote:

> Double-clicking them does produce RDoc-style  
> documentation. But how can I use ri to bring up that documentation  
> without resorting to Windows Explorer?

You could create a shortcut on your desktop to the docs, or you can  
type the command:

…/…/\> gem\_server

and then open up a browser and enter the address:

[http://localhost:8808](http://localhost:8808)

in your browser’s address bar. That should bring up a page that lists  
all rubygems you’ve installed with links to their rdocs.

Personally, I think the shortcut method is easier.

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [October 24, 2007, 4:45pm UTC](https://www.ruby-forum.com/t/how-to-use-ri-with-a-new-package/118132/3 "2007-10-24T16:45:39Z")

</div>

On Oct 24, 12:31 am, 7stud – [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> and then open up a browser and enter the address:
> 
> [http://localhost:8808](http://localhost:8808)
> 
> in your browser’s address bar. That should bring up a page that lists  
> all rubygems you’ve installed with links to their rdocs.
> 
> Personally, I think the shortcut method is easier.
> 
> –  
> Posted viahttp://www.ruby-forum.com/.

Great response! I chose option #1. Getting something like  
[RDoc Documentation](http://www.ruby-doc.org/stdlib/) for my installed packages is exactly  
what I wanted. Thanks.

I’m going to try to incorporate those commands in a Windows’ WHS  
script.

Again, thanks.  
Richard

---

<div class="post-metadata">

**Author:** ![RichardOnRails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e0b2c6/32.png) [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Post date:** [October 25, 2007, 9:35pm UTC](https://www.ruby-forum.com/t/how-to-use-ri-with-a-new-package/118132/4 "2007-10-25T21:35:52Z")

</div>

On Oct 24, 10:44 am, RichardOnRails  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > all rubygems you’ve installed with links to their rdocs.  
> > script.
> 
> Again, thanks.  
> Richard- Hide quoted text -
> 
> - Show quoted text -

ri Sys::Admin

will get you the ri documentation you want
