Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jruby error on init; error on IO.popen(); fails when cmd is string, works when cmd is array #10

Open
bwalsh opened this issue Feb 24, 2013 · 2 comments

Comments

@bwalsh
Copy link

bwalsh commented Feb 24, 2013

note brackets around cmd []
cmd is a string or an array as follows.

      @engine = IO.popen([cmd],"w+")

environment

java -version
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)

jruby -v
jruby 1.7.2 (1.9.3p327) 2013-01-04 302c706 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_09-b05 [Windows 7-amd64]

trace

I've added a few puts() statements to trace ...

  puts "R cmd #{cmd}"
     begin
       @engine = IO.popen(cmd,"w+")
     rescue Exception => e  
        puts "e.message=#{e.message}"
        puts e.backtrace
        puts e.inspect  
        raise e.message
     end  
  puts "R @engine #{@engine}"

with the brackets ...

jruby -S irb
irb(main):001:0> require "rinruby"
R start
R require java
R platform windows-java
R executable "C:/Program Files/R/R-2.15.2/bin/i386/Rterm.exe"
R loaded readline
R cmd "C:/Program Files/R/R-2.15.2/bin/i386/Rterm.exe" --ess --slave
R @engine #IO:0x51a4f310

without the brackets ...

jruby -S irb
irb(main):001:0> require "rinruby"
R start
R require java
R platform windows-java
R executable "C:/Program Files/R/R-2.15.2/bin/i386/Rterm.exe"
R loaded readline
R cmd "C:/Program Files/R/R-2.15.2/bin/i386/Rterm.exe" --ess --slave
e.message=
java.lang.ProcessImpl.(ProcessImpl.java:181)
java.lang.ProcessImpl.start(ProcessImpl.java:133)
java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
jnr.posix.util.Java5ProcessMaker.start(Java5ProcessMaker.java:139)
org.jruby.util.ShellLauncher.buildProcess(ShellLauncher.java:492)
org.jruby.util.ShellLauncher.popenShared(ShellLauncher.java:734)
org.jruby.util.ShellLauncher.popen(ShellLauncher.java:693)
org.jruby.RubyIO.popen19(RubyIO.java:3931)
org.jruby.RubyIO$INVOKER$s$0$2$popen19.call(RubyIO$INVOKER$s$0$2$popen19.gen)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:216)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:212)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:346)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:204)
c_3a_.Users.bwalsh.jruby_minus_1_dot_7_dot_2.lib.ruby.gems.shared.gems.rinruby_minus_2_dot_0_dot_3.lib.rinruby.chained_6_rescue_4$RUBY$SYNTHETICinitialize(c:/Users/bwalsh/jruby-1.7.2/lib/ruby/gems/shared/gems/rinruby-2.0.3/lib/rinruby.rb:173)

@clbustos
Copy link
Owner

Ok, I will check it.

@bwalsh
Copy link
Author

bwalsh commented Feb 24, 2013

Much appreciated. Thanks so much for the quick response!
-b

-Brian Walsh

On Sat, Feb 23, 2013 at 6:45 PM, Claudio Bustos notifications@github.comwrote:

Ok, I will check it.


Reply to this email directly or view it on GitHubhttps://github.com//issues/10#issuecomment-14002381.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants