0

私は Rails 3.2.8 をインストールしており、gem update --system が言う最新の ruby​​ gem は、Mac で ruby​​ 1.9.3-p194 を実行しています。

私がする時

gem rdoc railties --ri --overwrite 

大量の警告が表示されます。( --overwrite は違いはありません)。さまざまな人が不満を言っているのを見つけましたが、解決策はありません。

エラーを sort -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

これは Railties の問題ですか、それとも ruby​​gems の問題ですか、それとも私のローカル セットアップの問題ですか?

それを回避する方法はありますか?

4

2 に答える 2

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"
于 2012-09-19T13:47:00.630 に答える
0

エラーが発生した場合、RubyGems は明示的にエラーを報告し、ゼロ以外のエラー コードで終了します。最初のケースでは、お気づきのとおり、警告のみが表示されます。

これらの警告は RubyGems で修正されていますが、修正を RubyGems 1.8 にバックポートするのは簡単ではありません。

2 番目のケースについては、Ruby 2.0 の「デフォルトの gem」機能でこれを解決することを目指しています。bigdecimal ドキュメントは ruby​​ の一部として出荷されるため、再生成する必要はありません。

于 2012-09-18T16:07:38.293 に答える