相关疑难解决方法(0)

Ruby相当于Python的帮助()?

在交互式Python中工作时,我倾向于依靠内置help()函数来告诉我期望和/或返回的内容,并打印出可能对我有帮助的任何文档.有没有Ruby相当于这个功能?

我正在寻找一些我可以在irb中使用的东西.例如,在交互式Python中我可以输入:

>>> help(1)
Run Code Online (Sandbox Code Playgroud)

然后打印

Help on int object:

class int(object)  |  int(x[, base])
-> integer  |    |  

Convert a string or number to an integer, if possible. A ...
Run Code Online (Sandbox Code Playgroud)

ruby python

19
推荐指数
3
解决办法
5175
查看次数

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 …
Run Code Online (Sandbox Code Playgroud)

ruby installer

10
推荐指数
3
解决办法
6292
查看次数

标签 统计

ruby ×2

installer ×1

python ×1