Skip to content
This repository

Gem::Specification#default_executable is deprecated #345

Closed
jensb opened this Issue April 07, 2011 · 30 comments
jensb
jensb commented April 07, 2011

How can I avoid this warning?

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 ..../shared/bundle/ruby/1.8/bundler/gems/rspec-core-f6cb5923912f/rspec-core.gemspec:17

Thanks,
Jens

David Chelimsky
Owner

Already fixed: 7070a15

David Chelimsky dchelimsky closed this April 07, 2011
David Chelimsky
Owner

To avoid the warning you can roll back rubygems or wait for the next rspec-core release.

Michael T. Halligan

How far back do we have to downgrade rubygems to get rid of this incredibly obnoxious warning?

David Chelimsky
Owner

If you upgrade to rspec-core-2.6.0.rc4, rspec's gemspec will not produce this warning, but a lot of other gems still might. I'm not sure which rubygems version introduced this particular deprecation - you can find that out from the rubygems project maintainers.

As an aside, why do you find deprecation warnings incredibly obnoxious? I'd, personally, much rather be advised of what changes to expect than to have them sneak up on me. You can always redirect stderr to a file if you don't want to see the warnings.

Robert J. Berger
rberger commented May 06, 2011

Its unpleasant when a fundamental tool like rubygems makes a change that causes almost every gem in existence to produce enough warnings to scroll off the screen for each gem...

dawson commented May 06, 2011

If you're using RVM, the following command will fix it rvm rubygems current

David Chelimsky
Owner

@rberger - what other process would you recommend for communicating downstream?

FYI - per http://blog.zenspider.com/2011/05/rubygems-18-is-coming.html, you can do this to eliminate many of the warnings:

gem pristine --all --no-extensions

If the remaining warnings still bug you, I'd recommend downgrading rubygems until gem authors have time to address the issue.

Dimitar Haralanov

Any suggestions on how to fix these warnings for Ruby 1.9 (no RVM)? Just like @rberger said - it's quite unpleasant.

David Chelimsky
Owner

@dalizard - did you try gem pristine --all --no-extensions?

Dimitar Haralanov

@dchelimsky Yes, I did and it removed most of the warnings. A few are left though.

Robert J. Berger
rberger commented May 06, 2011

Yeah the gem pristine --all --no-extensions helped but still about a screenful of lines everytime a program that use gems is run.

I did find the gem pristine --all --no-extensions mentioned in only one place that I could find last nite (Eric Hodel's) blog.

By the way, I apologize for complaining here, its clearly not an rspec (which is such a great contribution to Software Development!) it was the only place I found it being discussed when googling last nite. RubyGems is too of course, I'm wondering if all the folks who use rubygems but are not particularly gem developers will also see this issue the next time they do a simple gem update --system and not have a clue what is going on? The note that comes up after doing the update doesn't really mention that this might happen and how to fix it as a user.

The Gem user can't do all that much to fix a depreciated feature in a Gem that they are just a consumer of.

Thanks for the response to not quite on-topic post though!

Michael T. Halligan
David Chelimsky
Owner

Of course I've seen it :) In my work-related app development environments I immediately downgraded back to 1.7 and then I fixed the problem in rspec-core.

The thing is that deprecation warnings are a GOOD THING. They don't break your software, and they give everybody ample time to upgrade and fix things downstream before they DO break your software. Imagine if the rubygems team decided to try to coordinate with every gem developer first, or worse, didn't coordinate at all and just notified the world via a blog post that shit was going to break soon. Things would be awful in either scenario. It's not perfect, but given that we all work on open source on our own time, often without any remuneration at all, a managed deprecation process seems like a pretty good deal to me.

Dimitar Haralanov

So, I have a quick question here. The warnings don't really bother me, but I did run the gem pristine --all --no-extensions anyway. I still get a few, but if I downgrade to rubygems-update 1.7 (I'm actually with Ruby 1.9, no RVM) that still won't completely remove them, correct?

David Chelimsky
Owner

@dallizard - it will remove any of the warnings that are new to 1.8, but if there were any warnings in 1.7 (which I think there were), those will still be there. I downgraded one box to 1.3.7 and haven't seen any warnings at all :)

Dimitar Haralanov

@dchelimsky Thank you! I was just curious. And while I'm spending more time on Objective-C now, by the time I finish the few projects I have, those warnings would be gone :)

Blair Williams

@dchelimsky -- "gem pristine --all --no-extensions" didn't help this issue at all and @Dawson, when I run "rvm rubygems current" I get "Cannot switch to 1.3.7 for this interpreter." ... Does anyone have any other suggestions?

These warnings are literally making it impossible for me to work. I get pages and pages of notices every-time I do anything in rails -- so I would really love to see if anyone else has any suggestions.

dawson commented May 08, 2011

@supercleanse I would remove the .rvm and reinstall it again, sounds like you've broken it elsewhere trying to fix the problem.

Waleed Al-Balooshi

For the warnings that aren't removed by

gem pristine --all --no-extensions

See if you get a warning like the following when you run the above command:

Skipped [gem_name], it needs to compile an extension AND this gem is one of the ones that gives you the error, then run the following command to remove the deprecation warnings for that gem:

gem pristine [name_of_gem_with_extension] -- --build-arg

Blair Williams

Thanks @walbalooshi -- I'll remember that for future consideration ... I actually reinstalled rvm and everything is working now :) ... Thanks @Dawson.

Jesse Streb
jstreb commented May 09, 2011

Reinstalling rvm also fixed it for me. Thank you

Bryan Siegel

@dawson via the rvm fix did it for me thx.

Atastor
Atastor commented May 10, 2011

@Dawson yepp, rvm rubygems current worked perfectly for me, too

Lee Reilly

gem pristine --all didn't work for me, but rvm rubygems current did. Cheers! :beer:

Henrik Mohr

rvm rubygems current did the trick - thanks!

Kewin Wang

gem pristine --all --no-extensions
is ok on Win and Linux

Ariel De La Rosa

rvm rubygems current worked perfectly for me too. ;-) thanks!

Robb Shecter

Here's why the warnings are obnoxious:

They're being displayed (1) to an audience (application developers) who cannot do anything about them, (2) at a time (whenever gem or rails is invoked) which is not the correct time to do something about them.

Below did the trick for me:
rvm rubygems current

Thanks Dawson!

oreatial

rvm rubygems current is good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.