Problem with ri or me?

D

Dave Miller

Hello --

I just installed Ruby a couple of days ago, and I have been going through
tutorials, etc. One thing I can't explain is that ri doesn't seem to work
on my system. I am running Ruby 1.8.6 on XP. I am trying to run ri through
irb 0.9.5. (Both things are what I got when I did the simple install a few
days ago.)

If I enter ri, I get something like "undefined method `ri' for main:Object
from (irb):4"

What am I doing wrong?

Thanks

Dave Miller
 
C

Chris Shea

Hello --

I just installed Ruby a couple of days ago, and I have been going through
tutorials, etc. One thing I can't explain is that ri doesn't seem to work
on my system. I am running Ruby 1.8.6 on XP. I am trying to run ri through
irb 0.9.5. (Both things are what I got when I did the simple install a few
days ago.)

If I enter ri, I get something like "undefined method `ri' for main:Object
from (irb):4"

What am I doing wrong?

Thanks

Dave Miller

You run ri from the command line, not from within irb.

Welcome to Ruby.

Chris
 
J

John Joyce

ri is a command line tool.

I had the same confusion when I first got started!

In irb, you can type the object_name.methods
dot methods will give you a list of methods for the object.
This is a good thing to keep in mind. It's one example of why irb is
so useful. Rather than combing through documentation all the time,
you can ask the object directly!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,786
Messages
2,569,626
Members
45,328
Latest member
66Teonna9

Latest Threads

Top