Skip to content

pty_background_process.rb depends on PTY::ChildExited which doesn't exist in JRuby 1.6.7 #4

@7er

Description

@7er

The relevant parts of the traceback

NameError: uninitialized constant PTY::ChildExited
const_missing at org/jruby/RubyModule.java:2642
wait at <....>/gems/background_process-1.3/lib/background_process/pty_background_process.rb:41

If we comment out line 46 and 47 as shown:

rescue PTY::ChildExited

true

Then everything seems to be hunky-dory (using background_service as the client component).

Some suggest solving this without having to comment out code under jruby:

1. Monkey patch the PTY module if ChildExited exception is not present:

unless PTY.constants.include?(:ChildExited)
  module PTY
    class ChildExited < RuntimeError
    end
  end
end

2. Fix the jruby pty module to include the ChildExited exception even though it is not used

3. Have alternate rescue clauses for rubies that don't have the PTY::ChildExited exception

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