Gem::Specification#default_executable is deprecated #345

Closed
jensb opened this Issue Apr 7, 2011 · 30 comments

Projects

None yet
@jensb
jensb commented Apr 7, 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

@dchelimsky
Member

Already fixed: 7070a15

@dchelimsky dchelimsky closed this Apr 7, 2011
@dchelimsky
Member

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

@mhalligan

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

@dchelimsky
Member

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.

@rberger
rberger commented May 6, 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
dawson commented May 6, 2011

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

@dchelimsky
Member

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

@dalizard
dalizard commented May 6, 2011

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

@dchelimsky
Member

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

@dalizard
dalizard commented May 6, 2011

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

@rberger
rberger commented May 6, 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!

@mhalligan

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 <
reply@reply.github.com>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:
#345 (comment)

@dchelimsky
Member

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.

@dalizard
dalizard commented May 6, 2011

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?

@dchelimsky
Member

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

@dalizard
dalizard commented May 6, 2011

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

@supercleanse

@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
dawson commented May 8, 2011

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

@walbalooshi

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

@supercleanse

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

@jstreb
jstreb commented May 9, 2011

Reinstalling rvm also fixed it for me. Thank you

@bryansiegel

@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

@leereilly

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

@luposlip

rvm rubygems current did the trick - thanks!

@kewinwang

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

@globalxolutions

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

@dogweather

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.

@mleszcz
mleszcz commented Jun 1, 2011

Below did the trick for me:
rvm rubygems current

Thanks Dawson!

@shiguodong

rvm rubygems current is good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment