A recent update to RubyGems is causing a lot of deprecation warnings like these:

[sourcecode]
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /usr/lib/ruby/gems/1.8/specifications/rubygems-update-1.4.1.gemspec:11.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /usr/lib/ruby/gems/1.8/specifications/bundler-1.0.7.gemspec:10.
NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem::Specification#default_executable= called from /usr/lib/ruby/gems/1.8/specifications/file-tail-1.0.5.gemspec:10.
[/sourcecode]

I generally like software to move forward and the way to do that is deprecate and then after a while, make backwards incompatible changes. It’s painful but there’s no other way.

I do have a problem with all the cron jobs of my web apps like Keep on Posting or DNSk9 flooding my inbox with those warnings. Thankfully, that’s not hard to fix. Where I was doing:

[sourcecode lang=”bash”]
rake pre_calculate_thingies > /dev/null
[/sourcecode]

now I’ll be doing:

[sourcecode lang=”bash”]
rake pre_calculate_thingies 2>&1 >/dev/null | grep -v default_executable
[/sourcecode]


Share:


Comments

3 responses to “Getting rid of RubyGems deprecation warnings”

  1. iGbanam iGravity Avatar

    What exactly does that line of code do?

    1. J. Pablo Fernández Avatar

      In short ti redirects stdout to /dev/null, stderr to stdout and filters out any line (in stdout) that contains default_executable.

  2. Zachary Burt Avatar

    alternatively you can just do

    gem pristine –all –no-extensions

Leave a Reply to Zachary Burt Cancel reply

Your email address will not be published. Required fields are marked *