How do I install the Ruby ri documentation?

None of the proposed solutions worked for me. In the end the solution I found was super simple, so I'll leave it here. (I'm running ruby 2.2.4 on win7 x64 in case that's relevant)

(captain obvious alert: ruby must be installed and in your PATH)

-open cmd

-$ gem install rdoc-data

-$ rdoc-data --install

And you're set! test that it worked by running:

-$ ri Array It should give you all the lovely documentation for the class!

Hope this helps!

ps. I just noticed that this is the solution that Luis Lavena proposed in a comment, but his comment wasn't clear to me so I had continued searching. Basically this is the same solution but explained more clearly so that that doesn't happen to anyone else :)

Cheers!


In case people on other platforms need to install their ri docs (like I did). This article gives the why and the how:

http://jstorimer.com/ri.html

The command is:

gem rdoc --all --ri --no-rdoc

If you are using rvm you should rvm docs generate (or just rvm docs generate-ri)

See this info (2011August) about rvm and ri

Tags:

Ruby