2012-05-13 9 views
6

MacPortsにはRuby on Railsがインストールされていますが、この言語を勉強したいので、昨日から更新して再作業しています。Ruby Docs Update Error

仕様

ruby -v 
ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-darwin10] 
rails -v 
Rails 3.0.3 
gem -v 
1.8.5 

ジャーニー

は、これまでのところ、私のMac上で動作するようにルビー、Railsと宝石を得るためにはかなりの旅となっています。チュートリアルを以下に私は/更新RailsのAPIドキュメントをインストールすることを決めたと私は、これらのエラーに走った:私がやったとき

Password: 
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 /opt/local/lib/ruby/site_ruby/1.8/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 /opt/local/lib/ruby/site_ruby/1.8/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. 
Gem::SourceIndex.from_gems_in called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:47. 
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#initialize called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:67. 
NOTE: Gem::SourceIndex#spec_dirs= is deprecated, use Specification.dirs=. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#spec_dirs= called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:94. 
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#refresh! called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:95. 
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#load_gems_in called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:320. 
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#add_spec called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:127. 
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It will be removed on or after 2011-11-01. 
Gem::SourceIndex#each called from /opt/local/lib/ruby/site_ruby/1.8/rubygems/commands/rdoc_command.rb:58. 
Installing ri documentation for activesupport-3.2.3... 

unrecognized option `--encoding' 

For help on options, try 'rdoc --help' 

ERROR: While generating documentation for activesupport-3.2.3 
... MESSAGE: exit 
... RDOC args: --ri --op /opt/local/lib/ruby/gems/1.8/doc/activesupport-3.2.3/ri --encoding UTF-8 lib --title activesupport-3.2.3 Documentation --quiet 

gem serverサーバが起動されました。だから私はたぶん1年前にドキュメントをインストールし、それを完全に忘れてしまった。

これらのエラーをすべて解決するにはどうすればよいですか?あるいは、私はそれらを無視して継続することができますか?

答えて

8

これらのエラーは無視しても問題ありません。

今のところ、これらのエラーなしでRailsをインストールするには、gem install rails --no-ri --no-rdocを指定して宝石をインストールできます。

、将来的に、あなたが追加することができます:

gem: --no-ri --no-rdoc 

あなた~/.gemrcファイルに、将来の宝石のインストールのドキュメントを無視グローバルに。

また、始めようとしているのであれば、rvmrbenvなどのルビーバージョンマネージャを使用することをお勧めします。これは、異なるルビーバージョンと宝石セットを管理するときの生活をずっと簡単にします。

+0

入力のためのありがとう@マークサンズ!あなたはRVMを推薦する二番目の男です。それを調べるつもりです。また、RailsS​​paceにはかなりの時間をかけて買った本が、古くなったコードがたくさんあることに気付きました。 – rhand

+0

問題ありません! rvmとrbenvの長所と短所を読んで、使用するバージョンマネージャーに関する独自の意見を作成してください。 –

3

Debian linuxで同じ警告が表示され、rvmruby-1.9.3-p194を使用しています。

私は、彼らが無交換で非推奨と言う他の人のためのよう127 Gem::Specification.add_spec gemspec if gemspec

~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb 

127 add_spec gemspec if gemspecのライン127を変更することにより、それらのほとんどを排除しました。

私はこれらについてもっと知ろうとしているので、このスレッドしか見つかりませんでした。 更新プログラムがあると思われますか? 警告は、2011-11-01以降に削除されることを示しています。 時が来て、今行った。

5

rdocバージョン< 3.0がある場合は、gem install rdocまたはgem update rdocを試してください。

RDocはRubyソースファイルからドキュメントを生成します。 @Mark Sandsによると、あなたのコードを実行させることは絶対に必要というわけではありません。あなたのエラーの根本を持っているといいです。

+0

+1これは問題を解決するよりもはるかに良いので、それを回避する... –

関連する問題