Use IO.popen instead of Open4.