Debugging embedded jruby

Are there any options for debugging, especially remote debugging, of
jruby when it runs embedded in java (eg: in an app server). I don’t see
how to use the JRuby Fast Debugger (rdebug and rdebug-ide) except by
launching the ruby script to be debugged directly on the command line.
But I don’t have this option when the ruby script runs within the
context of a webapp in an appserver, or when otherwise embedded.

http://betterlogic.com/roger/2010/08/how-to-debug-jruby-core-in-netbeans/
might help