我更新了ruby gems,现在我到处都得到解析树错误和弃用警告!

时间:2011-06-22 14:05:18

标签: ruby-on-rails ruby rubygems

简短的错误:

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:91.
/opt/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/gem_dependency.rb:275:in `==': undefined method `name' for "ParseTree":String (NoMethodError)

使用

ruby 1.8.7
rails 2.3.8
rubygems 1.8.5

我该怎么办?

我已经尝试删除rubygems文件夹,然后安装干净的rubygems ......但上面的错误仍然存​​在。

2 个答案:

答案 0 :(得分:9)

ruby​​gems的结构发生了很多变化,令很多人感到意外。它引入了许多常见应用程序和框架的不兼容问题。

您可能需要回滚到适用于您的系统的rubygems版本,例如1.6.0:

gem update --system 1.6.0

如果这不起作用,您可能需要调查slimgems这是一个1.3.7的rubygems分支,旨在解决这些兼容性问题。

答案 1 :(得分:0)

值得尝试更新bundeler

d:\ workspace \ dongxf \ projects \ ruby​​ \ arbref> rails s D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/rubygems_integration.rb:183:in stub_source_index170': uninitialized constant Gem::SourceIndex (NameError) from D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/rubygems_integration.rb:303:in stub_rubygems'         来自D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/rubygems_integration.rb:246:in replace_entrypoints' from D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:14:in setup'         来自D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler.rb:110:in setup' from D:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/setup.rb:7:in'         来自D:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in require' from D:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in rescue in require'         来自D:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in require' from d:/workspace/dongxf/projects/ruby/arbref/config/boot.rb:6:in'         来自D:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in require' from D:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in require'         来自script / rails:5:in''

d:\ workspace \ dongxf \ projects \ ruby​​ \ arbref> gem update bundle 更新已安装的宝石 更新捆绑包 获取:bundler-1.3.2.gem(100%) 已成功安装bundler-1.3.2 安装bundler-1.3.2的ri文档 为bundler-1.3.2安装darkfish文档 宝石更新:捆绑

d:\ workspace \ dongxf \ projects \ ruby​​ \ arbref> rails s =>引导瘦

enter image description here