Search code examples
jrubyrdocri

How do I install ri documentation in JRuby?


I installed JRuby 9.2.11.1 on a Windows system. After the installation has successfully completed, no ri documentation for core/stdlib is present. For instance:

C:\>ri Array
Nothing known about Array

I tried this solution How do I install the Ruby ri documentation? (admittedly, for Ruby Installer, not JRuby) to no avail. After trying to run rdoc --all --ri I obtain the following error message:

Before reporting this, could you check that the file you're documenting
has proper syntax:

  C:/jruby-9.2.11.1/bin/jruby.exe -c NEWS

RDoc is not a full Ruby parser and will fail when fed invalid ruby programs.

The internal error was:

        (NameError) undefined local variable or method `console' for IO:Class
Did you mean?  console_size

(Note: installed RDoc gem version is 6.1.2)


Solution

  • I found out: it seems that the JRuby version of io/console does not work well with the Windows Command prompt: https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/io/console/jruby.rb.

    A solution is, for example, to issue the rdoc --all --ri command within a Windows Git Bash rather than a Command prompt.