Gem.source_index is deprecated


Rails的版本问题真伤脑筋啊, 各种错,那也没有别的办法,遇到一个解决一个吧

F:\RailsApp\blog>ruby script/server
=> Booting WEBrick...
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on o
r after 2011-11-01.
Gem.source_index called from D:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/r
ails/gem_dependency.rb:21.
NOTE: Gem::SourceIndex#refresh! is deprecated with no replacement. It will be re
moved on or after 2011-11-01.
Gem::SourceIndex#refresh! called from D:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.
2.2/lib/rails/vendor_gem_source_index.rb:34.
NOTE: Gem::SourceIndex#load_gems_in is deprecated with no replacement. It will b
e removed on or after 2011-11-01.
Gem::SourceIndex#load_gems_in called from D:/Ruby187/lib/ruby/site_ruby/1.8/ruby
gems/source_index.rb:322.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It wi
ll be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems
/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It wi
ll be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems
/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It wi
ll be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems
/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It wi
ll be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems
/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It wi
ll be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems
/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It wi
ll be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems
/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It wi
ll be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems
/source_index.rb:127.
NOTE: Gem::SourceIndex#add_spec is deprecated, use Specification.add_spec. It wi
ll be removed on or after 2011-11-01.
Gem::SourceIndex#add_spec called from D:/Ruby187/lib/ruby/site_ruby/1.8/rubygems
/source_index.rb:127.
NOTE: Gem::SourceIndex#initialize is deprecated with no replacement. It will be
removed on or after 2011-11-01.
Gem::SourceIndex#initialize called from D:/Ruby187/lib/ruby/gems/1.8/gems/rails-
2.2.2/lib/rails/vendor_gem_source_index.rb:100.

我的开发环境是ruby1.8.7 rails 2.2.2

解决办法就是执行: gem update --system, 再次重启就好了, 因为我之前用的是Rails3, rubygems的版本用的
是1.8.X,装了rails2.2.2和ruby1.8.7以后,没有更新rubygems的版本

F:\RailsApp\blog>gem update --system 1.6.2
Updating rubygems-update
Fetching: rubygems-update-1.6.2.gem (100%)
Successfully installed rubygems-update-1.6.2
Installing RubyGems 1.6.2
RubyGems 1.6.2 installed

锘?== 1.6.2 / 2011-03-08

Bug Fixes:

* require of an activated gem could cause activation conflicts.  Fixes
  Bug #29056 by Dave Verwer.
* `gem outdated` now works with up-to-date prerelease gems.


------------------------------------------------------------------------------

RubyGems installed the following executables:
        D:/Ruby187/bin/gem

RubyGems system software updated

F:\RailsApp\blog>ruby script/server
=> Booting WEBrick...
=> Rails 2.2.2 application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2012-04-26 22:32:09] INFO  WEBrick 1.3.1
[2012-04-26 22:32:09] INFO  ruby 1.8.7 (2011-12-28) [i386-mingw32]
[2012-04-26 22:32:09] INFO  WEBrick::HTTPServer#start: pid=1252 port=3000
 

















你可能感兴趣的:(Rails)