When I use IO::popen
with a non-existent command, I get an error message printed to the screen:
irb> IO.popen "fakefake"
#=> #<IO:0x187dec>
irb> (irb):1: command not found: fakefake
Is there any way I can capture this error, so I can examine from within my script?