开发者

Gem.source_index is deprecated, use Specification. Should I re-install Gem or Rails?

I'm learning RoR on Ubuntu 11. Got the following message when I was trying to generate an app. Did I install something incorrectly?

$ rails generate controller Pages home contact
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/shared_helpers.rb:3.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/source.rb:162.
NOTE: Gem::SourceIndex#each is deprecated with no re开发者_StackOverflow社区placement. It will be removed on or after 2011-11-01.
Gem::SourceIndex#each called from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/source.rb:162.
NOTE: Gem.source_index is deprecated, use Specification. It will be removed on or after 2011-11-01.
Gem.source_index called from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.12/lib/bundler/shared_helpers.rb:84.


This worked for me: downgrade rubygems:

gem update --system 1.6.2

found this advice at: Gem.source_index is deprecated, use Specification #34


Try this:

sudo gem update bundler

This will update bundler to most recent version (currently 1.0.15). This will not generate the warning or at least in my case this was the cause of the warning.


The best way to solve this is:

$ gem pristine --all --no-extensions

This will rebuild all gems (excluding those with native extensions) and update their gemspecs. If you don't have any gems with native extensions or you didn't use any custom compile flags on those gems you can also omit the --no-extensions flag. Otherwise you'll have to build them seperately.


I tried "sudo gem update". After that, I don't see the message "Gem.source_index is deprecated, use Specification..." anymore. Yay!


rails -v = 2.2.2

ruby -v = 1.8.7

This link helps me.

or simply do

gem update --system 1.6.2
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜