为什么ri对Rails一无所知?

时间:2012-01-05 06:58:00

标签: ruby-on-rails ruby ri

$ ri link_to
Nothing known about .link_to

实际上,似乎ri对Rails一无所知。但ri --list-doc-dirs显示包含Rails文件夹:

/usr/share/ri/1.8/system
/usr/share/ri/1.8/site
/root/.rdoc
/usr/lib64/ruby/gems/1.8/doc/actionmailer-2.3.5/ri
/usr/lib64/ruby/gems/1.8/doc/actionpack-2.3.5/ri
/usr/lib64/ruby/gems/1.8/doc/activerecord-2.3.5/ri
/usr/lib64/ruby/gems/1.8/doc/activeresource-2.3.5/ri
/usr/lib64/ruby/gems/1.8/doc/activesupport-2.3.5/ri
/usr/lib64/ruby/gems/1.8/doc/cgi_multipart_eof_fix-2.5.0/ri
/usr/lib64/ruby/gems/1.8/doc/columnize-0.3.5/ri
/usr/lib64/ruby/gems/1.8/doc/daemons-1.0.10/ri
/usr/lib64/ruby/gems/1.8/doc/fastthread-1.0.1/ri
/usr/lib64/ruby/gems/1.8/doc/gem_plugin-0.2.3/ri
/usr/lib64/ruby/gems/1.8/doc/json-1.6.3/ri
/usr/lib64/ruby/gems/1.8/doc/linecache-0.46/ri
/usr/lib64/ruby/gems/1.8/doc/macaddr-1.0.0/ri
/usr/lib64/ruby/gems/1.8/doc/mime-types-1.17.2/ri
/usr/lib64/ruby/gems/1.8/doc/mongrel-1.1.5/ri
/usr/lib64/ruby/gems/1.8/doc/mongrel_cluster-1.0.5/ri
/usr/lib64/ruby/gems/1.8/doc/multipart-post-1.1.4/ri
/usr/lib64/ruby/gems/1.8/doc/postgres-0.7.9.2008.01.28/ri
/usr/lib64/ruby/gems/1.8/doc/rack-1.0.1/ri
/usr/lib64/ruby/gems/1.8/doc/rake-0.8.7/ri
/usr/lib64/ruby/gems/1.8/doc/rbx-require-relative-0.0.5/ri
/usr/lib64/ruby/gems/1.8/doc/rdoc-3.12/ri
/usr/lib64/ruby/gems/1.8/doc/rdoc-tags-1.2/ri
/usr/lib64/ruby/gems/1.8/doc/rest-client-1.6.7/ri
/usr/lib64/ruby/gems/1.8/doc/ruby-debug-0.10.4/ri
/usr/lib64/ruby/gems/1.8/doc/ruby-debug-base-0.10.4/ri
/usr/lib64/ruby/gems/1.8/doc/sqlite3-ruby-1.2.4/ri
/usr/lib64/ruby/gems/1.8/doc/uuidtools-2.1.1/ri

它出了什么问题?

更新

我在/usr/lib64/ruby/gems/1.8/doc/actionpack-2.3.5/ri/ActionView/Helpers/UrlHelper/

的文件夹中找到了这些yaml文件
button_to-i.yaml  cdesc-UrlHelper.yaml  current_page%3f-i.yaml  link_to-i.yaml  link_to_if-i.yaml  link_to_unless-i.yaml  link_to_unless_current-i.yaml  mail_to-i.yaml  url_for-i.yaml

但在另一个ri运行良好的系统中,文件为*.ri,而不是*.yaml

2 个答案:

答案 0 :(得分:3)

你试过跑步吗?

gem rdoc rails 

来自文档:

Summary:
  Generates RDoc for pre-installed gems

Description:
  The rdoc command builds RDoc and RI documentation for installed gems.  Use
  --overwrite to force rebuilding of documentation.

答案 1 :(得分:2)

我发现安装ri文档的唯一可靠方法是这样(即它安装最新的Rails,包括ri文档):

sudo gem install rails --pre --ri