Reputation: 9101
I've recently installed Ruby 1.9.1 on Windows 7, and apparently it doesn't come with the standard ri documentation. So when I do 'ri Array', I get:
C:\>ri Array
Nothing known about Array
Is there a way I can install this documentation so that the above works?
Upvotes: 27
Views: 21657
Reputation: 18843
You might run into this issue under Docker. The official docker
images come with no documentation, and apparently disable installing gem documentation.
If image's and system ruby
versions match (specifically, RbConfig::CONFIG["ruby_version"]
, which is e.g. 2.6.0
for ruby-2.6.1
), you can:
# apk add ruby-doc
# cp -r /usr/share/ri /usr/local/share/ri
Upvotes: 0
Reputation: 8398
Things are still largely the same with Ruby Installer 2.4.1.2 (year 2017). If I run ri Array
, it shows Array < Object
and nothing else. If I run ri "Array#each"
, I get the familiar "Nothing known..." message. In short, the ri-format documentation on Ruby core and standard libraries are missing.
Here's how I got my copy of core/stdlib ri-documentation. Of course, Ruby must be installed prior to this.
cd
to that folder and run rdoc --all --ri
~/.rdoc
directory.Now if you try running ri Array
or ri "Array#each"
you'll get the documentation in all its glory.
Run rdoc --all --ri
on directory containing source code for same ruby version as your installed version.
rvm docs generate-ri
could work, but you have to use Cygwin or Ubuntu on Windows (if on Windows 10) to use rvm
.gem rdoc --all --ri --no-rdoc
installs ri-documentation for all your gems. It doesn't install the core/stdlib documentations.gem install rdoc-data
followed by rdoc-data --install
only works for Ruby versions up to 2.3.0.Upvotes: 7
Reputation: 51
RVM does not automatically generate and install each Ruby's ri / rdoc documentation. You can generate using the following command: rvm docs generate
Upvotes: 5
Reputation: 109
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!
Upvotes: 10
Reputation: 9641
In case people on other platforms need to install their ri docs (like I did). This article gives the why and the how:
The command is:
gem rdoc --all --ri --no-rdoc
Upvotes: 38
Reputation: 633
If you are using rvm you should rvm docs generate
(or just rvm docs generate-ri
)
See this info (2011August) about rvm and ri
Upvotes: 24
Reputation: 10378
Seems you have installer Ruby 1.9.1 distributed by the RubyInstaller project.
You can use the Windows Help Files (CHM) that came with the installer instead of the ri documentation.
The problem of the RI documentation is that some versions of RDoc have problems generating it and also generated more than 10 thousands files which slowed down the installers considerably.
Upvotes: 5
Reputation: 4391
All the Ruby Docs are at http://www.ruby-doc.org
So the array documentation is at:
http://ruby-doc.org/core/classes/Array.html
Never tried it on windows but because its saying Nothing Known about X its not that its not installed just not got anything there.
Try installing a gem as you can then ri GEM_CLASS
as that should provide defentions, should let us see if its missing documentation or if ri's not looking in the right place
Upvotes: 0