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

Process#spawn error when redirecting standard and error output #1651

Closed
lorenzoplanas opened this issue Apr 22, 2014 · 1 comment
Closed
Milestone

Comments

@lorenzoplanas
Copy link

This snippet works on MRI 1.9.3 - as per the examples in http://ruby-doc.org/core-1.9.3/Process.html#method-c-spawn

Process.spawn("ls nonexistent_dir", [:out, :err]=>["log", "w"])

Using jruby 1.7.9 (1.9.3p392) 2013-12-06 87b108a on Java HotSpot(TM) 64-Bit Server VM 1.7.0_45-b18 [darwin-x86_64]
it throws a TypeError

TypeError: wrong exec option: [:out, :err]
  _spawn_internal at org/jruby/RubyProcess.java:1067
            spawn at file:/Users/lorenzo/.rubies/jruby-1.7.9/lib/jruby.jar!/jruby/kernel19/process.rb:13
           (root) at foo.rb:1
atambo added a commit that referenced this issue Apr 27, 2014
This doesn't exactly fix the issue in #1651 but it at least allows it
to run now.
@kares
Copy link
Member

kares commented May 23, 2017

this works on JRuby 9K these days :

jruby-9.1.9.0 :004 > Process.spawn("ls nonexistent_dir", [:out, :err]=>["log", "w"])
 => 3355 

@kares kares closed this as completed May 23, 2017
@kares kares added this to the JRuby 9.1.8.0 milestone May 23, 2017
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