Re: [jruby-user] Anything wrong with shelling out to jruby?

John Joseph Bachir <[email protected]> Mon, 23 Mar 2015 09:37:49 -0400
Newsgroups gmane.comp.lang.jruby.user
Message-ID <CAOf2Z5uvWD=5qSizTr5_e=WUSiOp16ASuhV=MG2zyXYJv1Oj_g@mail.gmail.com>
On Mon, Mar 23, 2015 at 3:02 AM, Christian MICHON <
[email protected]> wrote:

> Regarding pry debugging, you should use pry-remote instead of pry. Indeed,
> you may have launched the jruby job as a service without a console attached
> to it.
>

Good thinking. I did another test, but am still finding a new JVM being
created.

I wrote a script, shell-out-test.rb:

puts "starting script and sleeping for 5 seconds"
sleep 5
puts "shelling out for 10 seconds"
`ruby -e 'sleep 10'`
puts "done shelling out, sleeping another 5 seconds"
sleep 5


Then opened two terminals side-by-side. In one I ran:

  watch 'ps aux |grep [j]ava'

In the other I ran my script:

  ruby shell-out-test.rb

And I observed two java processes running while shelling out.