From: Luis Lavena Date: 2010-11-28T06:55:34+09:00 Subject: Re: Kernel.exec not behaving consistently on Windows? On Nov 27, 6:07 pm, Jarmo Pertman wrote: > Hello! > > It seems that Kernel.exec doesn't work consistently on Windows when > compared with Kernel.system or IO.popen. Consider the following > examples: > > This works: > exec "ping", "localhost" > > This doesn't work: > exec "ping.exe", "localhost" > Errno::ENOENT: No such file or directory - ping.exe > > This works: > exec "c:\\windows\\system32\\ping.exe", "localhost" > > This doesn't work: > exec "c:\\windows\\system32\\ping", "localhost" > Errno::ENOENT: No such file or directory - c:\windows\system32\ping > > By the way, all examples above seem to be working fine on 1.9 MRI, but > fail on 1.8 MRI. > Ruby 1.8.x Kernel#exec is broken. The changes required to fix this were so radical that couldn't be backported from 1.9.x to 1.8.x Rake for example workaround this: https://github.com/jimweirich/rake/blob/master/lib/rake/alt_system.rb -- Luis Lavena