Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to handle deprecated gem warning (SourceIndex#all_gems)? [duplicate]

Got this message today after running bundle update:

$ bundle update
NOTE: Gem::SourceIndex#all_gems is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::SourceIndex#all_gems called from /Users/meltemi/.rvm/gems/ruby-1.9.2-p180@ppr3/gems/bundler-1.0.13/lib/bundler/rubygems_integration.rb:256
.

Anyone know what it means and how to address it?

Note: This is a Rails 3.0.7 environment

like image 476
Meltemi Avatar asked May 04 '11 15:05

Meltemi


1 Answers

I got the same errors for a bunch of my gems in a non-Rails environment when I upgraded to rubygems 1.8.0. I got the warnings any time rubygems is required. Looking around the 'Net, it seems like it might be a problem also with rubygems 1.7.x, but I never had one of those versions installed so I'm not sure. I fixed this by running:

gem pristine --all --no-extensions

I had to run it a few times - it kept erroring out (but usually not in the same place from run to run). Eventually it got far enough that it had addressed the majority of my gems.

There were a few gems that didn't get their specifications regenerated correctly (json and sequel, specifically in my case) because they needed to build an extension. (The gem command output indicated it was skipping them, though it was easy to miss that message amidst all the deprecation warnings.) For those gems, I uninstalled them and then reinstalled them again (they'd previously been installed by bundler in rubygems 1.5.x) and that fixed the remaining warnings. It may be that I could have started with that plan of attack originally, but I didn't try.

like image 121
Andy Tinkham Avatar answered Sep 30 '22 17:09

Andy Tinkham