Problems with net-ssh

D

daniel

Dear community,

I tried the net-ssh gem (net-ssh (2.0.2, 1.1.2)) with this little
program from the net-ssh webpage:

------- begin test.rb
require 'rubygems'
require 'net/ssh'

Net::SSH.start("terra", "osm", :password => "mypass") do |ssh|
result = ssh.exec!("ls -l")
puts result
end
-----end test.rb

I get the strange output

/users/osm/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib/net/ssh/config.rb:
69:in `load': undefined method `strip' for nil:NilClass
(NoMethodError)
from /users/osm/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib/net/
ssh/config.rb:62:in `foreach'
from /users/osm/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib/net/
ssh/config.rb:62:in `load'
from /users/osm/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib/net/
ssh/config.rb:48:in `for'
from /users/osm/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:32:in `inject'
from /users/osm/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib/net/
ssh/config.rb:48:in `each'
from /users/osm/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib/net/
ssh/config.rb:48:in `inject'
from /users/osm/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib/net/
ssh/config.rb:48:in `for'
from /users/osm/lib/ruby/gems/1.8/gems/net-ssh-2.0.2/lib/net/
ssh.rb:162:in `start'
from /nfs/xt3-homes/users/osm/opr/lib/fdb/fdb_2.0/bin/test.rb:
4

I can do a ssh to the machine terra in the shell without problems:

ssh osm@terra ls -l

works fine.

Here are some information about my system:

uname -a
Linux buin2 2.6.5-7.283-ss #4 SMP Fri Sep 28 13:24:48 PDT 2007 x86_64
x86_64 x86_64 GNU/Linux

ruby --version
ruby 1.8.6 (2007-09-23 patchlevel 110) [x86_64-linux]

ruby -ropenssl -e 'puts OpenSSL::OPENSSL_VERSION'
OpenSSL 0.9.7d 17 Mar 2004

Any Hints?

Thanks a lot
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top