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