require "win32ole"ws = WIN32OLE.new "MSWinsock.Winsock"# Retrieve LocalIP propertyipAddress = ws.localIPputs "The local IP is : #{ipAddress}"