title: Problem in using NET/TELNET class in ruby
body: <p>Hii all,
            I am telneting a machine using "net/telnet" class that comes in ruby but am having some starnge problem...This is below code i have</p>
  
  <pre><code>require 'net/telnet'
  ip="192.168.247.111"
  localhost = Net::Telnet::new("Host" =&gt;ip,
                             "Timeout" =&gt; 50,
  
                         "Prompt" =&gt; /[$%#&gt;] \z/n)
  
  localhost.login("root", "root") { |c| print c } 
  </code></pre>
  
  <p>Now when i run the above code i got en error like</p>
  
  <pre><code> c:/ruby/lib/ruby/1.8/net/telnet.rb:352:in `initialize': getaddrinfo: no address
   associated with hostname. (SocketError)
  </code></pre>
  
  <p>But if i harcoded th Ip address like "Host"=> "192.168.247.111"</p>
  
  <p>am able to make it work means able to telnet to machine...but my requirement it to assign from some variable ....How could i achieve it??</p>