Ruby on rails Ruby文档更新错误

Ruby on rails Ruby文档更新错误,ruby-on-rails,rubygems,Ruby On Rails,Rubygems,我已经在MacPorts上安装了Ruby on Rails,从昨天开始我一直在更新和修改它,因为我想重新学习这门语言 规格 ruby -v ruby 1.8.7 (2012-02-08 patchlevel 358) [i686-darwin10] rails -v Rails 3.0.3 gem -v 1.8.5 旅程 到目前为止,让Ruby、Rails和Gems在我的Mac上运行已经是一段相当漫长的旅程。在接下来的教程中,我决定安装/更新Rails API文档,并遇到了以下错误: Pass

我已经在MacPorts上安装了Ruby on Rails,从昨天开始我一直在更新和修改它,因为我想重新学习这门语言

规格

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

到目前为止,让Ruby、Rails和Gems在我的Mac上运行已经是一段相当漫长的旅程。在接下来的教程中,我决定安装/更新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
当我执行
gemserver
时,服务器启动了。所以我可能在一年前安装了docs,然后完全忘记了它


我能做些什么来消除所有这些错误?或者我可以安全地忽略它们并继续吗?

您可以安全地忽略这些错误

现在,您可以通过指定
gem install rails--no ri--no rdoc
来安装gems,以安装rails而不出现这些错误

将来,您可以添加:

gem: --no-ri --no-rdoc
到您的
~/.gemrc
文件,全局忽略将来安装gem的文档


另外,如果您刚刚开始,我建议您使用ruby版本管理器,如或。在管理不同的ruby版本和Gemset时,它让生活变得更加轻松。

我在
Debian
linux上得到了相同的警告,我正在使用
rvm
ruby-1.9.3-p194

我通过改变第127行来消除大部分错误

~/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb  
127添加规范gempec if gempec
127 Gem::Specification。添加规范gempec if gempec

至于其他人,他们说他们不赞成,没有替代品

我之所以找到这条线索,是因为我想了解更多关于这些的信息。 有人认为有更新吗? 警告说明这些将在
2011-11-01
当天或之后删除。
时间已经过去。

如果您的rdoc版本<3.0,请尝试
gem安装rdoc
gem更新rdoc


RDoc从Ruby源文件生成文档。因此,正如@marksands所说的,让代码运行并不是绝对必要的,它可以很好地解决错误的根源

感谢@Mark Sands的输入!你是第二个推荐RVM的人。我会调查的。我也意识到我很久以前买的书RailsSpace有很多过时的代码。没问题!请务必阅读rvm和rbenv的优缺点,以形成您自己对使用哪个版本管理器的看法。