diff --git a/test/io/console/test_io_console.rb b/test/io/console/test_io_console.rb index 3c44181f2ac0b6..27d8e4a9888d49 100644 --- a/test/io/console/test_io_console.rb +++ b/test/io/console/test_io_console.rb @@ -440,7 +440,9 @@ def helper def run_pty(src, n = 1) pend("PTY.spawn cannot control terminal on JRuby") if RUBY_ENGINE == 'jruby' - r, w, pid = PTY.spawn(EnvUtil.rubybin, "-I#{TestIO_Console::PATHS.join(File::PATH_SEPARATOR)}", "-rio/console", "-e", src) + args = ["-I#{TestIO_Console::PATHS.join(File::PATH_SEPARATOR)}", "-rio/console", "-e", src] + args.shift if args.first == "-I" # statically linked + r, w, pid = PTY.spawn(EnvUtil.rubybin, *args) rescue RuntimeError omit $! else