Hardcoded ruby interpreter location

Eric Wong normalperson at yhbt.net
Mon Dec 14 23:09:36 EST 2009


Russell Branca <chewbranca at gmail.com> wrote:
> ---Had some issues posting this, reposting, sorry if it does duplicate.
> 
> Hello,
> 
> I'm not sure if this is the correct send this bug report, but the 'Bug
> Tracker' link on gemcutter links to this mailing list.

Hi Russell, yes, the mailing list is a bug tracker here.

> I just saw this in gem version 0.95.2, in the shebang line of both
> bin/unicorn and bin/unicorn_rails the ruby interpreter is hard coded
> to:
> 
> #!/home/ew/bin/ruby
> 
> Which obviously isn't correct.

It doesn't matter, no matter what the source tree sets it to it's wrong
for somebody.  Which is why RubyGems installs its own bin wrapper for
all bins, and setup.rb rewrites the shebang line for you.

And using the generic:

  #!/usr/bin/env ruby

...is even worse, since it can setup an incorrect $0 on some platforms
so SIGUSR2 upgrade method fails.

I might as well make it:

  #!/shebang/will/be/rewritten/or/wrapped/anyways/ruby

So it's very wrong for everyone :)

-- 
Eric Wong


More information about the mongrel-unicorn mailing list