From: Bob Smyph Date: 2008-06-09T21:14:39+09:00 Subject: Re: Net::SSH problems stephen O'D wrote: > On Jun 6, 12:33 pm, Bob Smyph wrote: >> from c:/ruby/lib/ruby/site_ruby/1.8/net/ssh.rb:189:in `start' >> shell.cd "/file/trying/to/cd/to" >> end >> >> ----- >> >> - I would greatly appreciate any help. >> -- >> Posted viahttp://www.ruby-forum.com/. > > Not sure what is wrong - I do something similar (this is snipped from > a bigger application, so it may not be the most idiomatic way to do > this, but it seems to work): > > Net::SSH.start( CONFIG['target_machine'], CONFIG['user'], > CONFIG['password'] ) do |session| > shell = session.shell.sync > shell.send_command 'y' # To answer the 'are you allow to > authorize this computer questions > > commands = [ > "cd #{remote_dir}", > "chmod 777 somescript.ksh", > "./somescript.ksh" > ] > > commands.each do |c| > out = shell.send_command c > end > end > > I know the 'build an array of commands' is silly here, but as I said > its part of a bigger app - it does the 'cd', 'chmod' and runs the > script with no issues however. I tried the above and I still get the same error. # (NoMethodError) from c:/ruby/lib/ruby/site_ruby/1.8/net/ssh.rb:189:in `start' from C:/ruby/test/SSHtest.rb:95 Any more ideas? -- Posted via http://www.ruby-forum.com/.