+
Skip to content

JRuby --help fails if PAGER has an option #9026

@nobu

Description

@nobu

Environment Information

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)

    jruby 10.0.2.0 (3.4.2) 2025-08-07 cba6031bd0 OpenJDK 64-Bit Server VM 26-ea+17-Ubuntu-1 on 26-ea+17-Ubuntu-1 +indy +jit [aarch64-linux]
    
  • Operating system and platform (e.g. uname -a)

    Linux adequate-kid 6.17.0-5-generic #5-Ubuntu SMP PREEMPT_DYNAMIC Mon Sep 22 09:50:31 UTC 2025 aarch64 aarch64 aarch64 GNU/Linux
    

Other relevant info you may wish to add:

  • Installed or activated gems
  • Application/framework version (e.g. Rails, Sinatra)
  • Environment variables
    PAGER='less -RSs'

Expected Behavior

  • Describe your expectation of how JRuby should behave, perhaps by showing how CRuby/MRI behaves.
    LESS='less -RSs' ruby --help sends the help message to the pager, less with -RSs option.
    jruby should do similarly.

  • Provide an executable Ruby script or a link to an example repository.

Actual Behavior

  • Describe or show the actual behavior.

    $ LESS='less -RSs' jruby --help
    java.io.IOException: Cannot run program "less -RSs": error=2, No such file or directory
    	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1170)
    	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1089)
    	at org.jruby.dist/org.jruby.Main.doPrintUsage(Main.java:475)
    	at org.jruby.dist/org.jruby.Main.internalRun(Main.java:252)
    	at org.jruby.dist/org.jruby.Main.run(Main.java:227)
    	at org.jruby.dist/org.jruby.Main.main(Main.java:199)
    Caused by: java.io.IOException: error=2, No such file or directory
    	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
    	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:295)
    	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:225)
    	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1126)
    	... 5 more
  • Provide text or screen capture showing the behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载