Skip to content

Pik crashes when it tries to add JRuby 10.0.0 #159

@mohits-qi

Description

@mohits-qi

JRuby 10.0.0.0 has a version string as below:

$ jruby -v
jruby 10.0.0.0 (3.4.2) 2025-04-13 6ed59bc847 OpenJDK 64-Bit Server VM 21.0.5+11-LTS on 21.0.5+11-LTS +indy +jit [x86_64-mswin32]

When pik tries to get_version, it fails since the regex handles only single digit version parts.

$ pik add d:\stack\ruby\jruby-10.0.0.0\bin

There was an error.
 Error: private method `gsub' called for nil:NilClass

  in: pik/commands/command.rb:124:in `get_version'
  in: pik/commands/add_command.rb:23:in `add'
  in: pik/commands/add_command.rb:13:in `execute'
  in: pik_runner:33

The regex is ruby_ver =~ /ruby (\d\.\d\.\d)/i which assumes only single digit parts for the version number and so it does not match anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions