Issue Type: Bug Bug
Affects Versions: JRuby 1.7.0
Assignee: Thomas E Enebo
Components: Standard Library
Created: 25/Oct/12 4:39 PM
Description:

Here I try to use Open3.popen3() to execute a bash script which prints out the environment variable FOO.

Here are the contents of the bash script /tmp/tst.sh :

#!/bin/bash

echo $FOO

Here I am able to successfully execute it using MRI ruby 1.9.3-p194 :

1.9.3p194 :001 > require 'open3'
 => true 
1.9.3p194 :002 > r = nil; Open3.popen3({'FOO' => 'bar'}, '/tmp/tst.sh') { |sin, sout, serr, wthr| r = sout.gets }
 => "bar\n" 
1.9.3p194 :003 > 

Here it fails using jruby 1.7.0 :

jruby-1.7.0 :001 > require 'open3'
 => true 
jruby-1.7.0 :002 > r = nil; Open3.popen3({'FOO' => 'bar'}, '/tmp/tst.sh') { |sin, sout, serr, wthr| r = sout.gets }
IOError: Cannot run program "{"FOO"=>"bar"}" (in directory "/Users/tim/git/1/jux"): error=2, No such file or directory
	from org/jruby/RubyIO.java:3985:in `popen3'
	from /Users/tim/.rvm/rubies/jruby-1.7.0/lib/ruby/1.9/open3.rb:74:in `popen3'
	from (irb):2:in `evaluate'
	from org/jruby/RubyKernel.java:1065:in `eval'
	from org/jruby/RubyKernel.java:1390:in `loop'
	from org/jruby/RubyKernel.java:1173:in `catch'
	from org/jruby/RubyKernel.java:1173:in `catch'
	from /Users/tim/.rvm/rubies/jruby-1.7.0/bin/irb:13:in `(root)'
jruby-1.7.0 :003 > 
Environment: jruby 1.7.0 (1.9.3p203) 2012-10-22 ff1ebbe on Java HotSpot(TM) 64-Bit Server VM 1.7.0_07-b10 [darwin-x86_64]
Project: JRuby
Priority: Major Major
Reporter: Tim Olsen
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
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

Reply via email to