From: Hassan Schroeder Date: 2012-03-26T14:00:19+09:00 Subject: Re: net/ssh telnet set port 119 (nntp) On Sun, Mar 25, 2012 at 9:36 PM, Thufir wrote: > http://rubydoc.info/gems/net-ssh-telnet/0.0.2/frames > > example 1: > > s = Net::SSH::Telnet.new( >      "Dump_log" => "/dev/stdout", >      "Session" => ssh > ) > puts "Logged in" > p s.cmd("echo hello") > > That's not my code, that's the sample code. Really? Here's what I see in Example 1 -- ---------------------------------------------------------- Example 1 - pass existing Net::SSH::Session object ssh = Net::SSH.start("127.0.0.1", :username=>"test123", :password=>"pass456" ) s = Net::SSH::Telnet.new( "Dump_log" => "/dev/stdout", "Session" => ssh ) puts "Logged in" p s.cmd("echo hello") ---------------------------------------------------------- > What I'm asking is why the > sample code, when copied, pasted, gives errors as so: > ssh.rb:10:in `
': undefined local variable or method `ssh' Because you didn't copy all of it, and the variable 'ssh' in your broken abbreviated test isn't defined. Just what the error message says, unsurprisingly :-) -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com http://about.me/hassanschroeder twitter: @hassan