【问题标题】:How do I install ri documentation in JRuby?如何在 JRuby 中安装 ri 文档?
【发布时间】:2020-12-16 15:18:08
【问题描述】:

我在 Windows 系统上安装了 JRuby 9.2.11.1。 安装成功完成后,不存在 core/stdlib 的 ri 文档。 例如:

C:\>ri Array
Nothing known about Array

我尝试了这个解决方案How do I install the Ruby ri documentation?(诚然,对于 Ruby Installer,而不是 JRuby)无济于事。尝试运行rdoc --all --ri 后,我收到以下错误消息:

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

(注意:安装的 RDoc gem 版本为 6.1.2)

【问题讨论】:

    标签: jruby rdoc ri


    【解决方案1】:

    我发现:io/console 的 JRuby 版本似乎不适用于 Windows 命令提示符:https://github.com/jruby/jruby/blob/master/lib/ruby/stdlib/io/console/jruby.rb

    例如,一种解决方案是在Windows Git Bash 而不是命令提示符内发出rdoc --all --ri 命令。

    【讨论】:

      猜你喜欢
      • 2023-03-16
      • 1970-01-01
      • 1970-01-01
      • 2013-02-25
      • 2015-08-16
      • 2011-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多