From: Florian Gross Date: 2005-01-20T09:31:01+09:00 Subject: Re: Bad interpreter Chris Bennetts wrote: >> I think this issue will be fixed in the next Ruby release when you do >> #!/usr/bin/ruby -w (Might also not occur in it when you have a space >> after the "ruby", I'm not sure here, but "-w" is a good idea anyway.) > > It's not a Ruby problem at all. It's a kernel problem. The trailing ^M > on the #! line is causing the part of the kernel's exec() routines that > dispatches executable shell scripts to become confused. > > The only solution (apart from propogating a kernel patch) is to remove > the trailing ^M (carriage return) from the #! line. I know what's happening. This can be handled by Ruby in most cases. (The kernel just passes along the trailing \r to Ruby's ARGV.) That's why I suggested adding the -w flag. (So that the Kernel would not try to run the script with an executable called "ruby\r")