Hi,
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.
Paul
Dang, that’s in 1.6.7, BTW
Paul
“Paul E.C. Melis” paul@floorball.nl wrote in message
news:aom7rm$a1b$1@ares.cs.utwente.nl…
Hi,
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.
Paul
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.
···
- 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.
After all is said and done, a hell of a lot more is said than done.