Why does my Ruby 'ri' tool not return results in command prompt? [duplicate]

六眼飞鱼酱① 提交于 2019-11-27 00:10:56

问题


Possible Duplicate:
ruby 1.9 ri problem

When I try to use Ruby's ri tool in a command prompt window to get help about classes, methods, etc. it seems to always fail. For example if I type:

ri Array

I get a message saying:

Updating class cache with 0 classes... Nothing known about Array

I am using Vista 64 with Ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32] installed.

What should I do to configure ri to work?


回答1:


Although this question is old, nobody has yet provided a proper solution. I just ran into the same issue, and found the solution:

If you are using RVM:

rvm docs generate-ri # <- Just the ri docs, much faster
rvm docs generate    # <- Everything (rdoc + ri)

More info on managing RVM docs here:
https://rvm.io/rubies/docs

If not using RVM:

gem install rdoc-data

# Regenerate system docs
rdoc-data --install

# Regenerate all gem docs (rdoc + ri)
gem rdoc --all --overwrite 

# Regenerate all gem docs (ri only)
gem rdoc --all --overwrite --ri --no-rdoc

# Regenerate specific gem doc with specific version
gem rdoc gemname -v 1.2.3 --overwrite


来源:https://stackoverflow.com/questions/1575373/why-does-my-ruby-ri-tool-not-return-results-in-command-prompt

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!