[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Is this a Ruby Windows bug?

John Doe

12/15/2005 6:40:00 PM

I'm using Ruby on Windows via the One Click Installer version 1.8.2-15. I am
getting a weird error that I would like to isolate as either a configuration
issue, user error, or Ruby bug.

Basically I have a script (pr.rb) that calls another script (test.rb) via
the backtick operator. If the pr.rb script calls test.rb with output
redirection included everything works. If the pr.rb script calls test.rb
without output redirection Ruby fails.

Simple example:

test.rb:
print "Test\n"

pr.rb that works:
`test.rb > whocares`

pr.rb that fails
`test.rb`

The failure:

pr.rb:1:in ``': Exec format error - pr.rb (Errno::ENOEXEC)
from pr.rb:1

Note that the above scripts won't work on *nix as is as they do not invoke
the Ruby interpreter. On Windows as long as the file extension is .rb the
script will invoke the interpreter automatically.

(Sorry for the repost with a different subject line. I was thinking the
previous post's subject line was so obscure and the timing of the post was
so poor that it was ignored by people.)