diff --git a/lib/envutil.rb b/lib/envutil.rb index ab5e8d8..fef9a0c 100644 --- a/lib/envutil.rb +++ b/lib/envutil.rb @@ -225,7 +225,8 @@ def invoke_ruby(args, stdin_data = "", capture_stdout = false, capture_stderr = args = [args] if args.kind_of?(String) # use the same parser as current ruby - if args.none? { |arg| arg.start_with?("--parser=") } + if (args.none? { |arg| arg.start_with?("--parser=") } and + /^ +--parser=/ =~ IO.popen([rubybin, "--help"], &:read)) args = ["--parser=#{current_parser}"] + args end pid = spawn(child_env, *precommand, rubybin, *args, opt)