12

I'm using Windows XP SP2, and installed Ruby through Ruby 1.9 one click installer. Then when I try to using ri, I get the following response, can anyone help me with my problem?

C:\Documents and Settings\eyang>ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

C:\Documents and Settings\eyang>ri --version
ri 2.2.2

C:\Documents and Settings\eyang>ri String
Updating class cache with 0 classes...
Nothing known about String

C:\Documents and Settings\eyang>ri
Updating class cache with 0 classes...
No ri data found

If you've installed Ruby yourself, you need to generate documentation using:

  make install-doc

from the same place you ran `make` to build ruby.

If you installed Ruby from a packaging system, then you may need to
install an additional package, or ask the packager to enable ri generation.

C:\Documents and Settings\eyang>

By the way, when I try to use gem, I got the following error messages too, anyone can explain it?

C:\Documents and Settings\eyang>gem --version
1.3.5

C:\Documents and Settings\eyang>gem query --remote

*** REMOTE GEMS ***

ERROR:  While executing gem ... (Errno::ENOMEM)
    Not enough space - <STDOUT>

C:\Documents and Settings\eyang>
benzado
  • 82,288
  • 22
  • 110
  • 138
Just a learner
  • 26,690
  • 50
  • 155
  • 234

5 Answers5

16

Go to the same folder where your ruby is installed. Then do:

rdoc --all --ri
GregMoreno
  • 349
  • 2
  • 6
  • I ran it and it made ri work for me! :) But I don't know if it downloaded something or just recompiled something... :P [ruby 1.9.2p290, ri 2.5.8, rdoc 2.5.8] – thewillcole Oct 16 '11 at 05:50
  • 1
    it regenerates all ri info for all rb files under the root of your installation (gems included) in ~\.rdoc – Peter Kofler Nov 23 '11 at 22:04
  • I ended up using `rdoc --all --ri-site` so the ri files will be created under the `/share/ri` directory rather than in the home directory – Torben Knerr Dec 02 '14 at 09:50
  • 1
    ...however, it does not generate ri data for core + stdlib. For this you have to use the rdoc-data gem as mentioned by @rogerdpack below – Torben Knerr Dec 03 '14 at 06:44
9

RubyInstaller do not bundle RI documentation, as it increased the size of the distribution and the time to install the package.

Instead, we bundled CHM (Windows Help) files for both Core and StdLib API.

This was discussed in the RubyInstaller group and the decision was made on that base.

As for your other point, two things: you need to provide a gem name or part of it, since there are 12K gems in RubyForge.

Also, depending on your console configuration (Latin or something) the Not Enough space error will be related to the terminal itself, not RubyGems.

Luis Lavena
  • 10,348
  • 1
  • 37
  • 39
9

windows rubyinstaller doesn't come with the ri for core by default, so install the rdoc-data gem, then it will have it.

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
  • 1
    Thanks that helped. It should be mentioned that the above `rdoc --all --ri` does NOT install the ri data for core + stdlib! – Torben Knerr Dec 02 '14 at 22:30
  • asdf does not install ri for core. and rdoc-data gem does not support Ruby 2.4. Is there any other way to get "ri for core"? – kangkyu Dec 10 '17 at 09:14
  • @kangkyu FWIW appears they come as plain HTML these days: https://groups.google.com/forum/#!topic/rubyinstaller/QMRd0y-jiD8 – rogerdpack Dec 11 '17 at 15:16
4

If you are using rvm try $ rvm docs generate-ri

Hassan
  • 949
  • 7
  • 8
0

What might be helpful:

  1. When I ran ri.cmd -l command, it worked, though there were no known Classes/Modules CMD screenshot

  2. When I ran ri.cmd --list-doc-dirs, I've got:

    C:/Ruby25-x64/share/ri/2.5.0/system
    C:/Ruby25-x64/share/ri/2.5.0/site
    C:/Users/username/.rdoc</ul>
    

    Nonetheless, there was no physical .rdoc folder (C:/Users/username/.rdoc)

  3. Running rdoc --all --ri as recommended @GregMoreno did the trick

Vukašin Manojlović
  • 3,717
  • 3
  • 19
  • 31
laitart
  • 21
  • 4