From: Thomas Hurst Date: 2002-10-17T21:03:14+09:00 Subject: Re: Buggy shebang behavior with different newline style * Paul E.C. Melis (paul@floorball.nl) wrote: > After some puzzling I found out why my script with correct shebang > line (#!/usr/bin/env ruby) resulted in > > : No such file or directory > > when run as ./script.rb on my redhat linux system (it worked ok with > "ruby ../script.rb"). It turned out that the newlines in the script > file where done in dos style (0x0d, 0x0a) instead of common unix style > (0x0a) and converting the newlines solved the problem. This is an operating system thing, nothing to do with Ruby; the error is coming from it trying to execute the interpreter; irb(main):001:0> system("/usr/bin/env ruby\r") : No such file or directory The \r is moving the cursor to the start of the line then the error is overwriting the filename. -- Thomas 'Freaky' Hurst - freaky@aagh.net - http://www.aagh.net/ - After all is said and done, a hell of a lot more is said than done.