Ruby 使用 Winsock 2015/12/03 17481 require "win32ole" ws = WIN32OLE.new "MSWinsock.Winsock" # Retrieve LocalIP property ipAddress = ws.localIP puts "The local IP is : #{ipAddress}"