From: brabuhr@... Date: 2010-12-26T01:06:35+09:00 Subject: Re: net-ping error says "false" though server can be reached > I trying this > > irb(main):003:0> host='192.168.1.1' > => "192.168.1.1" > irb(main):004:0> tcp = Net::Ping::TCP.new(host) > => # @exception=nil, @host="192.168.1.1", @port=7> > irb(main):005:0> tcp.ping? > => false Is that host listening on TCP port 7? If not, try setting Net::Ping::TCP.econnrefused = true > BUT, > > ping 192.168.1.1 > PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data. > 64 bytes from 192.168.1.1: icmp_req=1 ttl=64 time=1.00 ms > 64 bytes from 192.168.1.1: icmp_req=2 ttl=64 time=1.00 ms > > I am confused. My guess of what's happening here is this: Ping::TCP tries to connect to port 7 on 1.1 1.1 is not listening on port 7 1.1 sends a connection refused message Ping::TCP reports false because the port is closed (If there is a firewall running on 1.1 that could make the situation more complex though.)