From: Robert Klemme Date: 2010-11-23T01:21:01+09:00 Subject: Re: debugging subprocess On Mon, Nov 22, 2010 at 5:08 PM, Chad Boyd wrote: > That didn't seem to do it either.  I put this in test/test_helper.rb, > which is included at the top of each test, and also tried it at the top > of the file in which the debugger statement is located (the class under > test), and neither resolved the issue. I don't know the details of ruby-debug, but are you sure that you can actually control your debugger? When I use the debugger which is part of the standard library I see that it does not work with a closed stdin. In your test you have a closed stdin (because of open "| ..." with "r"): 17:15:16 ~$ ruby19 -r debug -e '10.times do |i| puts i end' Debug.rb Emacs support available. -e:1:10.times do |i| (rdb:1) n -e:2:puts i (rdb:1) n 0 -e:2:puts i (rdb:1) n 1 -e:2:puts i (rdb:1) n 2 -e:2:puts i (rdb:1) n 3 -e:2:puts i (rdb:1) quit Really quit? (y/n) y 17:17:40 ~$ ruby19 -r debug -e '10.times do |i| puts i end' <&- Debug.rb Emacs support available. -e:1:10.times do |i| (rdb:1) 0 1 2 3 4 5 6 7 8 9 17:17:47 ~$ The first execution is normally, the second with closed stdin. The debugger shows the prompt once but does not work interactive. To work around this the debugger would have to open the current terminal in order to accept commands. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/