[Rake-devel] Question about system call and multiple arguments.

Luis Lavena luislavena at gmail.com
Sat Nov 1 12:42:47 EDT 2008

On Sat, Nov 1, 2008 at 1:26 PM, Luis Lavena <luislavena at gmail.com> wrote:
> Hello Everybody,
> [skip all the rambling]

I just realized how small and simple is the problem, and is not Rake fault.

- The multiple arguments rake is issuing is OK.
- system(...) is correctly accepting them.

But, system(...) on Windows is broken.

Previous test was using the full path to ruby location (using RUBY
constant defined in rake.rb:942). The thing is that Ruby on Windows
fails on that.

fullpath without extension (C:/Ruby/bin/ruby) works ok with one argument:

$ irb
irb(main):001:0> system("C:/Ruby/bin/ruby -v")
ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32]
=> true

But not with multiple:

irb(main):002:0> system("C:/Ruby/bin/ruby", "-v")
=> false

If instead I append the extension, it works.

irb(main):003:0> system("C:/Ruby/bin/ruby.exe", "-v")
ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32]
=> true

The funny fact is that from command line, it works:

Luis at KEORE (D:\Users\Luis\projects\oss\rake.git)
$ C:/Ruby/bin/ruby -v
ruby 1.8.5 (2007-09-24 patchlevel 114) [i386-mswin32]

with or without extension.

I consider this another bug, since the extension is not present or
required in other platforms, but looks like ruby on windows lookup for
executables is failing now.

Please disregard previous message, a patch for Ruby is underway.

Luis Lavena
Human beings, who are almost unique in having the ability to learn from
the experience of others, are also remarkable for their apparent
disinclination to do so.
Douglas Adams

More information about the Rake-devel mailing list