#443, using popen3 instaed of capture2 may work on ruby 1.8