I am trying to work through the following example given in my course notes:
require 'open3'
sin,sout,serr=Open3.popen3('nslookup')
sin.puts "www.google.co.nz"
print(sout.gets)
For some reason the code is hanging. I tried executing it in interactive mode and when I entered the last line and then pressed control c, reentering the command worked. Please assist.