我使用的是 Windows XP SP2,并通过 Ruby 1.9 一键安装程序安装了 Ruby。然后当我尝试使用 ri 时,我得到以下响应,有人可以帮助我解决我的问题吗?

C:\Documents and Settings\eyang>ruby --version
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

C:\Documents and Settings\eyang>ri --version
ri 2.2.2

C:\Documents and Settings\eyang>ri String
Updating class cache with 0 classes...
Nothing known about String

C:\Documents and Settings\eyang>ri
Updating class cache with 0 classes...
No ri data found

If you've installed Ruby yourself, you need to generate documentation using:

  make install-doc

from the same place you ran `make` to build ruby.

If you installed Ruby from a packaging system, then you may need to
install an additional package, or ask the packager to enable ri generation.

C:\Documents and Settings\eyang>

顺便说一句,当我尝试使用 gem 时,我也收到了以下错误消息,谁能解释一下?
C:\Documents and Settings\eyang>gem --version
1.3.5

C:\Documents and Settings\eyang>gem query --remote

*** REMOTE GEMS ***

ERROR:  While executing gem ... (Errno::ENOMEM)
    Not enough space - <STDOUT>

C:\Documents and Settings\eyang>

最佳答案

RubyInstaller 不捆绑 RI 文档,因为它增加了分发的大小和安装包的时间。

相反,我们为 Core 和 StdLib API 捆绑了 CHM(Windows 帮助)文件。

这在 RubyInstaller 小组中进行了讨论,并在此基础上做出了决定。

至于您的另一点,有两件事:您需要提供一个 gem 名称或其中的一部分,因为 RubyForge 中有 12K 个 gem。

此外,根据您的控制台配置(拉丁文或其他),空间不足错误将与终端本身有关,而不是 RubyGems。

关于Windows 上的 ruby​​ 1.9 ri 对任何类一无所知,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/1587354/

10-13 06:08