Gem.source_index is deprecated, use Specification. Should I reinstall Gem or Rails?

I am learning RoR on Ubuntu 11. I received the following message when I tried to create an application. Did I install something wrong?

$ 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 replacement. 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. 
+43
ruby ruby-on-rails deprecated
May 19 '11 at 22:08
source share
5 answers

This worked for me: downgrade rubygems:

 gem update --system 1.6.2 

found this tip: Gem.source_index is deprecated, use Specification No. 34

+52
Sep 24 2018-11-11T00:
source share

Try the following:

 sudo gem update bundler 

This will update the bundle to the latest version (currently 1.0.15). This will not cause a warning, or at least in my case it was the cause of the warning.

+28
Jun 28 2018-11-11T00:
source share

The best way to solve this problem:

 $ gem pristine --all --no-extensions 

This will restore all gems (except those with their own extensions) and update their gemspecs. If you do not have gems with native extensions or you have not used any custom compilation flags on these gems, you can also omit the --no-extensions flag. Otherwise, you will have to build them separately.

+14
May 19 '11 at 22:39
source share

I tried "sudo gem update". After that I do not see the message "Gem.source_index is out of date, use the specification ...". Hurrah!

+1
May 21 '11 at 3:35 a.m.
source share

rails -v = 2.2.2

ruby -v = 1.8.7

This link helps me.

or just do

 gem update --system 1.6.2 
-one
Aug 28 '13 at 7:28
source share



All Articles