From: Thufir Date: 2012-03-26T13:36:48+09:00 Subject: Re: net/ssh telnet set port 119 (nntp) On Mon, 26 Mar 2012 02:43:36 +0900, Hassan Schroeder wrote: >> Well, I don't get it, I have no idea why the sample code doesn't work >> for me. > > Because you're not using the sample code? Pardon, I don't understand: 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. What I'm asking is why the sample code, when copied, pasted, gives errors as so: thufir@dur:~/ruby/ssh$ thufir@dur:~/ruby/ssh$ thufir@dur:~/ruby/ssh$ ruby ssh.rb trying to connect... ssh.rb:10:in `
': undefined local variable or method `ssh' for main:Object (NameError) thufir@dur:~/ruby/ssh$ thufir@dur:~/ruby/ssh$ nl ssh.rb 1 require 'rubygems' 2 require 'net/ssh/telnet' 3 puts "trying to connect..." 4 s = Net::SSH::Telnet.new( 5 "Dump_log" => "/dev/stdout", 6 "Session" => ssh 7 ) 8 puts "Logged in" 9 p s.cmd("echo hello") thufir@dur:~/ruby/ssh$ thanks, Thufir