Found a similar problem with the windows version of sys-host a year ago.
Sorry I can't provide a patch, I've read the code but have not enough skills.
Tested with ubuntu 9.10 spanish, ruby 1.8.7 (2009-06-12 patchlevel 174) [i486-linux], rubygems 1.3.5, sys-host (0.6.1).
The ip is configured using DHCP. The system has two nics: wired eth0 (ip 10.139.108.123) and wireless eth1 (not
connected).
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'sys/host'
=> true
irb(main):003:0> Sys::Host.ip_addr
=> ["127.0.1.1"]
Ifconfig Output
> ifconfig
eth0 Link encap:Ethernet direcciónHW 00:16:ec:bc:1b:b5
Direc. inet:10.139.108.123 Difus.:10.139.108.255 Másc:255.255.255.0
eth1 Link encap:Ethernet direcciónHW 00:02:b3:ab:8b:0e
...
lo Link encap:Bucle local
Direc. inet:127.0.0.1 Másc:255.0.0.0
|