1

可能重复:
在尝试 ri String#upcase Ruby 时一无所知

版本信息如下所示:

 Hanfeis-MacBook-Pro-2:ruby ad9075$ rvm -v

 rvm 1.17.0 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

Hanfeis-MacBook-Pro-2:ruby ad9075$ ruby -v
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]
Hanfeis-MacBook-Pro-2:ruby ad9075$ ri -v
ri 3.12
Hanfeis-MacBook-Pro-2:ruby ad9075$ ri Math
Nothing known about Math

我试着做gem rdoc --all,它给出了一些NOTE,在我执行这个命令后,ri 仍然找不到这些库。

Hanfeis-MacBook-Pro-2:7w7l ad9075$ gem rdoc --all
NOTE: Gem::SourceIndex.from_installed_gems is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::SourceIndex.from_installed_gems called from /Users/ad9075/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/commands/rdoc_command.rb:58.
NOTE: Gem::SourceIndex.installed_spec_directories is deprecated, use Specification.dirs. It will be removed on or after 2011-11-01.
Gem::SourceIndex.installed_spec_directories called from /Users/ad9075/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:47.
NOTE: Gem::SourceIndex.from_gems_in is deprecated with no replacement. It will be removed on or after 2011-10-01.

从 /Users/ad9075/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:47 调用的 Gem::SourceIndex.from_gems_in。

当我尝试ri Integer时,它不是返回内置的文档Integer,而是返回我的结果,如下所示:

= Integer < Object

(from gem activesupport-3.2.9)
------------------------------------------------------------------------------

------------------------------------------------------------------------------
= Instance methods:

  month, months, multiple_of?, ordinalize, year, years

我认为问题可能是在我使用 rvm 切换到新版本的 ruby​​ 之后。ri配置不好,找不到内置函数和类的路径。有谁知道如何解决这个问题?

4

0 回答 0