Windows上的ruby 1.9 ri对任何类都一无所知
我正在使用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 - C:\Documents and Settings\eyang>
RubyInstaller不捆绑RI文档,因为它增加了分发的大小和安装包的时间。
相反,我们为Core和StdLib API捆绑了CHM(Windows帮助)文件。
这在RubyInstaller小组中进行了讨论,决定是在该基础上做出的。
至于你的另一点,有两点:你需要提供一个gem名称或部分名称,因为RubyForge中有12Kgem。
此外,根据您的控制台配置(拉丁语或其他内容),Not Enough space错误将与终端本身相关,而不是RubyGems。
转到安装ruby的同一文件夹。 然后做:
rdoc --all --ri
windows rubyinstaller默认没有ri for core,所以安装rdoc-data gem,然后就可以了。
如果您使用的是rvm
尝试$ rvm docs generate-ri
什么可能有用:
-
当我运行
ri.cmd -l
命令时,虽然没有已知的类/模块,但它仍然有效 -
当我运行
ri.cmd --list-doc-dirs
,我得到了:C:/Ruby25-x64/share/ri/2.5.0/system C:/Ruby25-x64/share/ri/2.5.0/site C:/Users/username/.rdoc
但是,没有物理
.rdoc
文件夹(C:/Users/username/.rdoc
) -
按照推荐的@GregMoreno运行
rdoc --all --ri
–ri就可以了