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 error to stdout (jruby #3627

vassilios opened this issue Jan 29, 2016 · 1 comment


Copy link

Redirecting stderr to stdout in spawn gives an exception.

$ jirb
irb(main):001:0> Process.spawn('ls -al',:err => :out)
Java::JavaLang::ArrayIndexOutOfBoundsException: -2
from org.jruby.RubyProcess.spawn(

Same thing happens if you use STDERR => STDOUT or 2 => 1 (instead of :err => :out) as shown in

This was run on:
$ jruby -v
jruby (2.2.2) 2015-11-12 b9fb7aa OpenJDK 64-Bit Server VM 24.91-b01 on 1.7.0_91-b02 +jit [linux-amd64]

Copy link

headius commented Mar 4, 2016

It appeared to work ok for me on 9.1:

$ jruby -e "Process.spawn('ls -al',:err => :out)"
total 490264
drwxr-xr-x   61 headius  staff       2074 Mar  4 11:57 .
drwxr-xr-x  144 headius  staff       4896 Feb 25 15:18 ..
drwxr-xr-x   18 headius  staff        612 Mar  4 12:06 .git

If it's still broken for you with a 9.1 snapshot from, reopen this issue.

@headius headius closed this as completed Mar 4, 2016
@headius headius added this to the JRuby milestone Mar 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants