zooter
zooter

Reputation: 2208

How to install Ruby ri documentation for Ruby v2.1.7

Can somebody point me to how I can install the ri documentation for v2.1.7?

I tried "How do I install the Ruby ri documentation?" with no luck.

I would prefer installing ri so that I can lookup specific methods in a class directly without opening the help file.

Also, I had no luck with the following:

C:\Users\ram\ruby>gem install rdoc-data
Fetching: rdoc-data-4.0.1.gem (100%)
rdoc-data is only required for C ruby 1.8.7 or 1.9.1.

rdoc-data is required for JRuby.

To install ri data for RDoc 4.0+ run:

  rdoc-data --install

Successfully installed rdoc-data-4.0.1
Parsing documentation for rdoc-data-4.0.1
Installing ri documentation for rdoc-data-4.0.1
Done installing documentation for rdoc-data after 1 seconds
1 gem installed

C:\Users\ram\ruby>ri Array
Nothing known about Array

C:\Users\ram\ruby>rdoc-data --install
Your ruby version 2.1.7 is not supported, only 1.8.7, 1.9.2, 1.9.3, 2.0.0

It seems that for v2.1.7 something else is required.

Note this is for Windows. I want to do it natively without using VM/Cygwin, etc.

Upvotes: 0

Views: 638

Answers (1)

femmestem
femmestem

Reputation: 621

As your error message indicates, rdoc-data doesn't support ruby 2.1.7.

If you're using RVM, try:

rvm docs generate

Be patient, it takes several minutes to install the documentation.

If you want the ri documentation installed by default for all gem installations, check your gem config file ~/.gemrc to see if you have defaults set up that excludes documentation. Remove any and all of the following:

install: --no-rdoc --no-ri 
update: --no-rdoc --no-ri
install: --no-document
update: --no-document
gem: --no-document

I believe gems install documentation by default. If not, add this to the gem config file

gem: --ri

Since you're on Windows, you can install Cygwin on your Windows machine and then install RVM using Cygwin. Or, you can download the rdocs source files http://ruby-doc.org/downloads/ and extract them to your Ruby docs folder /Users/userprofile/.rvm/gems/ruby-2.1.7/doc/. I did a cursory glance, and didn't see ruby 2.1.7; it goes straight from 2.1.6 to 2.2.0. You can dump 2.1.6 in the ruby-2.1.7/doc/ folder or update your Ruby version to one that is supported.

Upvotes: 2

Related Questions