rspec-core icon indicating copy to clipboard operation
rspec-core copied to clipboard

Gem::Specification#default_executable is deprecated

Open jensb opened this issue 15 years ago • 30 comments

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

jensb avatar Apr 07 '11 19:04 jensb

Already fixed: 7070a1545b78e43e5e3510d8363723c088903a51

dchelimsky avatar Apr 07 '11 19:04 dchelimsky

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

dchelimsky avatar Apr 07 '11 19:04 dchelimsky

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

mhalligan avatar May 05 '11 17:05 mhalligan

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.

dchelimsky avatar May 05 '11 17:05 dchelimsky

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...

rberger avatar May 06 '11 07:05 rberger

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

ghost avatar May 06 '11 08:05 ghost

@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.

dchelimsky avatar May 06 '11 10:05 dchelimsky

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

dalizard avatar May 06 '11 10:05 dalizard

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

dchelimsky avatar May 06 '11 10:05 dchelimsky

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

dalizard avatar May 06 '11 11:05 dalizard

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!

rberger avatar May 06 '11 16:05 rberger

I eventually got the problem fixed after enough yak shaving. I had needlessly run a gem update, which caused this problem. I'm guessing that you don't underst and why it's obnoxious because you haven't seen this problem in action. In practice, any usage of any gem causes dozens to hundreds of lines of these deprecation messages to get dumped to stdout, thus rendering any local ruby development (or usage of ruby scripts which require gems). My apologies for my tone.

On Thu, May 5, 2011 at 10:08 AM, dchelimsky < [email protected]>wrote:

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.

Reply to this email directly or view it on GitHub: https://github.com/rspec/rspec-core/issues/345#comment_1106867

mhalligan avatar May 06 '11 17:05 mhalligan

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.

dchelimsky avatar May 06 '11 17:05 dchelimsky

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?

dalizard avatar May 06 '11 18:05 dalizard

@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 :)

dchelimsky avatar May 06 '11 18:05 dchelimsky

@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 :)

dalizard avatar May 06 '11 18:05 dalizard

@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.

supercleanse avatar May 08 '11 04:05 supercleanse

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

ghost avatar May 08 '11 08:05 ghost

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

walbalooshi avatar May 09 '11 18:05 walbalooshi

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

supercleanse avatar May 09 '11 19:05 supercleanse