avoid deadlocks. Since pipes are fixed length buffers, ::popen3(“prog”) {|i, o, e, t| o.read } deadlocks if the program generates too much output on stderr. You should read stdout and stderr simultaneously (using threads or IO.select). However, if you don’t need stderr output, you can use :: popen2. If merged stdout and stderr output is not a problem, you can use :: popen2e. If you really need stdout and stderr output as separate strings, you can consider ::capture3. RubyDoc - Open3#popen3