CLONE -Kernel.exec will not use a modified ENV["PATH"] to locate commands on Windows ------------------------------------------------------------------------------------
Key: JRUBY-5856 URL: http://jira.codehaus.org/browse/JRUBY-5856 Project: JRuby Issue Type: Bug Components: Core Classes/Modules, Intro Affects Versions: JRuby 1.4, JRuby 1.5 Environment: Windows XP SP 3; Java 1.6.0; jruby 1.4.0 and 1.5.0 Reporter: Tricia Ball Assignee: Vladimir Sizikov Fix For: JRuby 1.6RC1 Demonstrate with this simple test: * Create batch file: C:\testdir\batchdir\test.bat containing: echo "This is test.bat" * Create ruby file: C:\testdir\test.rb containing: {noformat} paths = (ENV["PATH"] || "").split(File::PATH_SEPARATOR) paths.unshift "c:\\testdir\\batchdir" ENV["PATH"] = paths.uniq.join(File::PATH_SEPARATOR) Kernel.exec "test.bat" {noformat} * And run: {noformat} C:\testdir>jruby test.rb test.rb:9: No such file or directory - test.bat (Errno::ENOENT) {noformat} * But using binary Ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32] it works just fine: {noformat} C:\testdir>ruby test.rb C:\testdir>echo "This is test.bat" "This is test.bat" {noformat} I found this when trying to use Bundler's 'bundle exec' command, which uses the same technique. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email