[Rubygems-developers] Adjusting Shebang in gem files

Chad Fowler chad at chadfowler.com
Fri Sep 22 16:33:39 EDT 2006


On Sep 22, 2006, at 10:47 AM, Jim Weirich wrote:

> Jim Freeze wrote:
>> Hello all:
>>
>> I am working on a patch to rubygems that allows the user
>> to specify a shebang that is valid for a heterogeneous installation
>> of gems (multi OS env). Basically, this means that the path to  
>> ruby is
>> not specified explicitly in the shebang, but is set to:
>>
>>   #!/usr/bin/env ruby
>
> I have no problem with making this the default shebang line.  However,
> in reviewing the code for writing the current shebang line, it seems
> that we carefully preserve any command line switches from the original
> code base (e.g. the -w flag).
>
> If I recall correctly, ruby command line switches are not passed to  
> Ruby
> when using the env version of the shebang line (indeed, any switches
> found there will be passed to env, not Ruby).
>
> So, the question is, how should this be handled?  If the original code
> passes switches, should we:
>
> (1) ignore them
> (2) fallback to the current style of shebang.
>
> Prehaps it would be better to keep the current default so that  
> switches
> are preserved by default, and only use the env version if requested.
>
> Thoughts?
>


Personally I'm of the opinion that the default should be that we  
maintain the current behavior.  Particularly with binary gems, we  
can't guarantee that the ruby in the path will work with the gem in  
question.  I just maintain separate hardcoded gem installations for  
the versions of Ruby I have installed.

Chad


More information about the Rubygems-developers mailing list