Hal Fulton wrote:
> I just installed Net::SSH 0.0.3 and started to play with it.
> 
> The first simple thing I tried bombed on me.
> 
> All info below.
> 
> Jamis or whoever else -- thanks for any assistance.
> 
> 
> Cheers,
> Hal
> 
> 
> 
> (This is FC1 and Ruby 1.8.2)
> 
> Here's the script (a trivial mod of one of the examples):
> 
> 
>   require 'net/ssh'
> 
>   domain = 'WhoWantsToKnow.com'
>   user   = 'hal'
>   pass   = 'yeah,youwish'
> 
>   Net::SSH.start(domain,user,pass) do |session|
>     result = session.exec( "ls -la" )
>     puts result.data
>     puts "-------------------------------------------"
>     result = session.exec( "ls -la /" )
>     puts result.data
>     puts "-------------------------------------------"
>     result = session.exec( "echo $HOME" )
>     puts result.data
>   end
> 
> 
> And here's the result:
> 
> 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in 
> `initialize': wrong number of arguments (0 for 1) (ArgumentError)
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in 
> `new'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/kex/dh.rb:60:in 
> `exchange_keys'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/session.rb:292:in 
> `exchange_keys'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh/transport/session.rb:124:in 
> `initialize'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:119:in `new'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:119:in 
> `open'
>         from 
> /usr/local/lib/ruby/gems/1.8/gems/net-ssh-0.0.3/lib/net/ssh.rb:67:in 
> `start'
>         from ssh1.rb:7

Hal,

It looks like you're using an unpatched version of the OpenSSL module 
for Ruby. One of the changes I submitted to that module was to allow 
"blank" keys to be created, and initialized later. Previously, the key 
constructors always required at least one parameter.

Can you please verify that you are, indeed, using 1.8.2? (I assume you 
mean, by 1.8.2, that you're using a CVS snapshot...?) When did you 
install it? Could it be that you are using a version that is "old" 
enough that it doesn't include the patch I submitted?

Thanks,

Jamis

-- 
Jamis Buck
jgb3 / email.byu.edu
http://www.jamisbuck.org/jamis

"I use octal until I get to 8, and then I switch to decimal."