警告做宝石rdoc railties --ri

时间:2012-09-15 14:13:23

标签: ruby-on-rails-3 rubygems

我安装了Rails 3.2.8,gem更新--system说是最新的ruby gems,在Mac上运行ruby 1.9.3-p194。

当我这样做时

gem rdoc railties --ri --overwrite 

我收到过多的警告。 ( - overwrite没有区别)。我发现各种各样的人抱怨但没有解决方案。

通过排序-u传递错误,唯一的行是:

Gem::SourceIndex#add_spec called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:127.
Gem::SourceIndex#initialize called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:67.
Gem::SourceIndex#load_gems_in called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:322.
Gem::SourceIndex#refresh! called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:95.
Gem::SourceIndex#search called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/commands/rdoc_command.rb:64.
Gem::SourceIndex#spec_dirs= called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:94.
Gem::SourceIndex.from_gems_in called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:47.
Gem::SourceIndex.from_installed_gems called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/commands/rdoc_command.rb:64.
Gem::SourceIndex.installed_spec_directories called from /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:47.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01.
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01.
NOTE: Gem::SourceIndex#search is deprecated with no replacement. It will be removed on or after 2011-11-01.
NOTE: Gem::SourceIndex#spec_dirs= is deprecated, use Specification.dirs=. It will be removed on or after 2011-11-01.
NOTE: Gem::SourceIndex.from_gems_in is deprecated with no replacement. It will be removed on or after 2011-10-01.
NOTE: Gem::SourceIndex.from_installed_gems is deprecated with no replacement. It will be removed on or after 2011-10-01.
NOTE: Gem::SourceIndex.installed_spec_directories is deprecated, use Specification.dirs. It will be removed on or after 2011-11-01.

这是我的宝石列表:

*** LOCAL GEMS ***

actionmailer (3.2.8)
actionpack (3.2.8)
activemodel (3.2.8)
activerecord (3.2.8)
activerecord_constraints (0.1.1)
activeresource (3.2.8)
activesupport (3.2.8)
arel (3.0.2)
bigdecimal (1.1.0)
builder (3.0.3)
bundler (1.1.3)
capistrano (2.13.3)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.3.3)
daemons (1.1.8)
dalli (2.2.1)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.4.0)
highline (1.6.14)
hike (1.2.1)
i18n (0.6.1)
io-console (0.3)
journey (1.0.4)
jquery-rails (2.1.2)
jquery-ui-rails (2.0.0)
jruby-pageant (1.0.2)
json (1.7.5)
mail (2.4.4)
mime-types (1.19)
minitest (2.5.1)
multi_json (1.3.6)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.5.2)
net-ssh-gateway (1.1.0)
pg (0.14.1)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
rack-ssl (1.3.2)
rack-test (0.6.1)
rails (3.2.8)
rails-footnotes (3.7.8)
railties (3.2.8)
rake (0.9.2.2)
rdoc (3.12)
rubygems-update (1.8.24)
sass (3.1.19)
sass-rails (3.2.5)
sprockets (2.1.3)
sqlite3 (1.3.6)
thin (1.4.1)
thor (0.16.0)
tilt (1.3.3)
treetop (1.4.10)
tzinfo (0.3.33)
uglifier (1.2.5)

“ick”是“ri Rails :: Engine”产生没有输出,实际上它有很多非常漂亮的文档。我经常在我的Mac上碰到这个问题,并想在我的Mac上运行一整套文档。

命令

可能是一个单独的问题
gem rdoc bigdecimal --ri

产生相同的警告,但以:

结束
ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory - /usr/local/prvm/ruby-1.9.3-p194/lib/ruby/gems/1.9.1/gems/bigdecimal-1.1.0

这是铁路还是rubygems或我当地设置的问题?

有什么方法可以解决它吗?

2 个答案:

答案 0 :(得分:0)

如果出现错误,RubyGems将明确说出并以非零错误代码退出。对于第一种情况,正如您所注意到的,您只会看到警告。

这些警告已在RubyGems中得到修复,但将修复程序反向移植到RubyGems 1.8并不容易。

对于第二种情况,我们的目标是使用Ruby 2.0中的“默认gems”功能来解决这个问题。 bigdecimal文档作为ruby的一部分提供,因此无需重新生成它。

答案 1 :(得分:0)

问题非常糟糕。我错误地将警告与“gem rdoc railties”没有产生内部文档的事实相关联。我终于找到了那个特定的问题。出于某种原因,gem规范排除了所有文件。只需删除该行,即可获得良好的文档。

diff -c /tmp/railties-3.2.8.gemspec ./railties-3.2.8.gemspec 
*** /tmp/railties-3.2.8.gemspec 2012-09-19 08:40:57.000000000 -0500
--- ./railties-3.2.8.gemspec    2012-09-19 08:39:32.000000000 -0500
***************
*** 12,18 ****
s.executables = ["rails"]
s.files = ["bin/rails"]
s.homepage = "http://www.rubyonrails.org"
!   s.rdoc_options = ["--exclude", "."]
s.require_paths = ["lib"]
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
s.rubygems_version = "1.8.24"
--- 12,18 ----
s.executables = ["rails"]
s.files = ["bin/rails"]
s.homepage = "http://www.rubyonrails.org"
!   # s.rdoc_options = ["--exclude", "."]
s.require_paths = ["lib"]
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
s.rubygems_version = "1.8.24"
相关问题