How to install Ruby ri documentation?

I recently installed Ruby 1.9.1 on Windows 7, and apparently it does not come with standard ri documentation. So when I do "ri Array", I get:

C:\>ri Array Nothing known about Array 

Is there any way to install this documentation to work above?

+22
ruby
Jul 05 2018-10-10 at
source share
7 answers

It seems you have the Ruby 1.9.1 installer distributed by the RubyInstaller project.

You can use the Windows Help (.chm) files that come with the installer instead of the ri documentation.

The problem with RI documentation is that some versions of RDoc have problems creating it, and also generate more than 10 thousand files, which significantly slows down the work of installers.

+6
Jul 05 '10 at 14:16
source share

In case people on other platforms need to install their documents (like me). This article explains why and how:

http://jstorimer.com/ri.html

Team:

 gem rdoc --all --ri --no-rdoc 
+29
Dec 14
source share

If you use rvm , you should rvm docs generate (or just rvm docs generate-ri )

See this information (2011August) about rvm and ri

+19
Feb 21 '13 at 15:32
source share

None of the proposed solutions worked for me. In the end, the solution I found was very simple, so I will leave it here. (I am running ruby ​​2.2.4 on win7 x64 in case this is relevant)

(captain's obvious warning: a ruby ​​must be installed in your PATH as well)

-open cmd

 -$ gem install rdoc-data -$ rdoc-data --install 

And you are tuned! check if it works:

-$ ri Array It should provide you with all the great documentation for the class!

Hope this helps!

ps. I just noticed that this is a solution that Louis Lavena suggested in a comment, but his comment was not clear to me, so I continued to search. Basically this is one and the same solution, but explained more clearly so that this does not happen to anyone else :)

Hurrah!

+7
Feb 23 '16 at 9:08
source share

RVM does not automatically create or install every Ruby ri / rdoc documentation. You can create the following command: rvm docs generates

+4
Apr 01 '16 at 12:08 on
source share

All Ruby documents are at http://www.ruby-doc.org

So the array documentation:

http://ruby-doc.org/core/classes/Array.html

I never tried this on the windows, but because his statement “Nothing Known about X” does not mean that it is not installed, nothing worked.

Try to set the gem as you can, then ri GEM_CLASS , as this should provide a waiver, should let us see if its missing documentation is missing or if ri does not look in the right place

0
Jul 05 '10 at 13:11
source share

In Ruby Installer 2.4.1.2 (2017), it still remains to a large extent. If I run ri Array , it shows Array < Object and nothing else. If I run ri "Array#each" , I get the familiar message "Nothing known ...". In short, there is no ri-format documentation for the Ruby kernel and standard libraries.

This is how I got my copy of the core / stdlib ri documentation. Of course, Ruby must be installed before this.

  • Get the ruby ​​source code that most closely matches my version from their Github releases page .
  • Extract the .zip or .tar.gz archive to some folder
  • Open cmd.exe / Powershell, cd in this folder and run rdoc --all --ri
    • This command recursively analyzes .c, .rb files and several other file types in the current directory and generates ri-documentation in the ~/.rdoc .
    • Took about 5 minutes on my laptop with an i7-3520M processor to complete, without errors.
  • Delete the archive and directory containing the source code because we no longer need them.

Now, if you try to run ri Array or ri "Array#each" , you will get documentation in all its glory.

TL; DR

Run rdoc --all --ri in the directory containing the source code for the same ruby ​​version as your installed version.




Appendix Z: Comments on Other Answers

  • rvm docs generate-ri may work, but you must use Cygwin or Ubuntu on Windows (if on Windows 10) use rvm .
  • gem rdoc --all --ri --no-rdoc installs ri documentation for all of your gems. It does not install core / stdlib documentation.
  • gem install rdoc-data , followed by rdoc-data --install , works only for versions of Ruby prior to 2.3.0.
0
Aug 17 '17 at 17:41 on
source share



All Articles