From: Ryan Davis Date: 2011-09-20T08:42:15+09:00 Subject: Re: Net::Telnet doesnt work but command line telnet does On Sep 19, 2011, at 16:14 , Tim A. wrote: > irb(main):004:0> telet = Net::Telnet.new("Host" => "localhost", "Port" > => 4444, "Prompt" => //) > Errno::ECONNREFUSED: Connection refused - connect(2) > from /usr/lib/ruby/1.8/net/telnet.rb:352:in `initialize' > from /usr/lib/ruby/1.8/net/telnet.rb:352:in `open' > from /usr/lib/ruby/1.8/net/telnet.rb:352:in `initialize' > from /usr/lib/ruby/1.8/timeout.rb:67:in `timeout' > from /usr/lib/ruby/1.8/timeout.rb:101:in `timeout' > from /usr/lib/ruby/1.8/net/telnet.rb:351:in `initialize' > from (irb):4:in `new' > from (irb):4 > from :0 > > with commandline: > > telnet localhost 4444 > Trying ::1... > Connected to localhost. > Escape character is '^]'. > VLC media player 1.1.9 The Luggage > Remote control interface initialized. Type `help' for help. I'm just guessing... but that "Trying ::1" line hints that /usr/bin/telnet is trying both ipv4 and ipv6 and I'd bet dollars to donuts that net/telnet is only trying ipv4. You can probably confirm with 'netstat -an | grep 4444.*LISTEN'