[ANN] Net::SSH 0.6.0

J

James Britt

Jamis said:
Here's another release of Net::SSH, your friendly neighborhood pure-Ruby
SSH2 client protocol implementation.


Is this supposed to work on Windows with the 1-click installer?


Running this code:

require 'rubygems'
require 'net/ssh'

Net::SSH.start( 'jamesbritt.com', 'user', 'password' ) do |session|
result = session.exec( "ls -la " )
puts result.data
end

I get this error:

c:/ruby/lib/ruby/gems/1.8/gems/net-ssh-0.6.0/lib/net/ssh/transport/ossl/key-factory.rb:52:in
`initialize': wrong number of arguments (0 for 1) (ArgumentError)





Thanks,


James
 
J

Jamis Buck

James said:
Is this supposed to work on Windows with the 1-click installer?


Running this code:

require 'rubygems'
require 'net/ssh'

Net::SSH.start( 'jamesbritt.com', 'user', 'password' ) do |session|
result = session.exec( "ls -la " )
puts result.data
end

I get this error:

c:/ruby/lib/ruby/gems/1.8/gems/net-ssh-0.6.0/lib/net/ssh/transport/ossl/key-factory.rb:52:in
`initialize': wrong number of arguments (0 for 1) (ArgumentError)

It looks like the version of the Ruby/OpenSSL module you have installed
is not the right version... The RSA and DSA keys in the version in 1.8.2
allow for a no-argument constructor, whereas prior versions in did, and
that's the problem you are seeing.

Try this:

ruby -ropenssl -e "OpenSSL::pKey::DSA.new"

If that fails, then you know you've got the wrong version. If it
succeeds...well, let me know.

- Jamis
 
A

Austin Ziegler

...
It looks like the version of the Ruby/OpenSSL module you have installed
is not the right version... The RSA and DSA keys in the version in 1.8.2
allow for a no-argument constructor, whereas prior versions in did, and
that's the problem you are seeing.

The Windows Installer doesn't include OpenSSL.

-austin
 
J

James Britt

Jamis said:
...
It looks like the version of the Ruby/OpenSSL module you have installed
is not the right version... The RSA and DSA keys in the version in 1.8.2
allow for a no-argument constructor, whereas prior versions in did, and
that's the problem you are seeing.

Try this:

ruby -ropenssl -e "OpenSSL::pKey::DSA.new"

If that fails, then you know you've got the wrong version. If it
succeeds...well, let me know.

c:\> ruby -ropenssl -e "OpenSSL::pKey::DSA.new"
-e:1:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
from -e:1:in `new'
from -e:1


I think we had this discussion during RubyConf2004; I have been unable
to locate and install a proper OpenSSL lib.

Should the 1-click installer include SSL libs that Just Work? I may
have screwed up my libs in October while trying to get SSH running, but
I recently installed the latest 1-click 1.8.2, so I was hoping it would
have been bundled with the correct SSL lib.

Has anyone gotten Net:SSH working with the 1-click version?


Thanks,


James
 
J

Jamis Buck

James said:
c:\> ruby -ropenssl -e "OpenSSL::pKey::DSA.new"
-e:1:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
from -e:1:in `new'
from -e:1


I think we had this discussion during RubyConf2004; I have been unable
to locate and install a proper OpenSSL lib.

Should the 1-click installer include SSL libs that Just Work? I may
have screwed up my libs in October while trying to get SSH running, but
I recently installed the latest 1-click 1.8.2, so I was hoping it would
have been bundled with the correct SSL lib.

Has anyone gotten Net:SSH working with the 1-click version?

Well, I have, but only because I compiled the Ruby/OpenSSL module
myself. It relies on version 8 of the msvcrt dll, which you may or may
not have installed, but if you'd like I can send along (or post) the
binary version I created.

- Jamis
 
J

James Britt

Jamis said:
Well, I have, but only because I compiled the Ruby/OpenSSL module
myself. It relies on version 8 of the msvcrt dll, which you may or may
not have installed, but if you'd like I can send along (or post) the
binary version I created.

Thank you; I may take you up on the offer of the binary. I have
numerous copies of msvcrt.dll, though the latest seems to be version
6.something. Where does one get version 8?

I'd be most interested in understanding how to reproduce this myself, in
part because I know of people who are interested in using Ruby for
corporate admin tools, but problems with SSL on Windows hold them back.

I think the ideal situation would be to have the required DLL included
in the 1-click installer; maybe the next best thing is a set of clear
instructions on creating the DLL. And the a pre-compiled binary as a
fall back.


Thanks again,

James
 
C

Curt Hibbs

James said:
Thank you; I may take you up on the offer of the binary. I have
numerous copies of msvcrt.dll, though the latest seems to be version
6.something. Where does one get version 8?

I'd be most interested in understanding how to reproduce this myself, in
part because I know of people who are interested in using Ruby for
corporate admin tools, but problems with SSL on Windows hold them back.

I think the ideal situation would be to have the required DLL included
in the 1-click installer; maybe the next best thing is a set of clear
instructions on creating the DLL. And the a pre-compiled binary as a
fall back.

I'm planning to incloude OpenSSL in the next time I post a release of the
One-Click Installer. I haven't yet tried to build/integrate OpenSLL, so I
don't know if I'll run into any problems. But when I asked about this on
ruby-talk, the responses seem to indicate I should not have any problems.

Curt
 
J

James Britt

Curt said:
...
I'm planning to incloude OpenSSL in the next time I post a release of the
One-Click Installer. I haven't yet tried to build/integrate OpenSLL, so I
don't know if I'll run into any problems. But when I asked about this on
ruby-talk, the responses seem to indicate I should not have any problems.


Thank you, that is great news.

BTW, what compiler are you using?

Thanks,

James
 
J

Jamis Buck

Curt said:
I'm planning to incloude OpenSSL in the next time I post a release of the
One-Click Installer. I haven't yet tried to build/integrate OpenSLL, so I
don't know if I'll run into any problems. But when I asked about this on
ruby-talk, the responses seem to indicate I should not have any problems.

Well, here's the process I went through to get this to work.
(Disclaimers: I am NOT a windows developer, nor a windows user, so I may
have made things much harder for me than they needed to be. Also, I do
not have access to MSVC++, so I used the free commandline tools and the
Windows XP SP2 SDK, freely available from MS.)

1) Install the OpenSSL binary for Windows
(http://www.slproweb.com/products/Win32OpenSSL.html) Per the
instructions given at that site, I then copied the contents of the
'install' and 'lib/vc' subdirectories to the corresponding system
directories (so that the headers and libs are accessible without having
to set any INCLUDE or LIB environment variables).

2) Copy the 'ext/openssl' subdirectory from Ruby CVS.

3) I had to tweak mkmf.rb (apparently the version I had was older). I
added "header=nil" as the third parameter to the "have_library" method,
and passed 'header' as the third argument to #try_func in the same method.

4) I tweaked the ext/openssl/extconf.rb so that the calls to
have_library passed "openssl/ssl.h" as the 'header' parameter.
(Otherwise, the extconf.rb pass kept failing saying that the
OpenSSL_add_all_digests function was not defined. Maybe there is a
better way to do this--but I couldn't see any options to cl that said to
allow calls to functions without explicit prototypes...)

5) Running extconf.rb worked, at this point, and I got a makefile.

6) Running nmake then built the library.

Quite possibly the problems I encountered had more to do with my
ignorance of windows development than anything else, so it may be a much
simpler process to build Ruby/OpenSSL under Windows for someone who
knows what they are doing.

- Jamis
 
C

Curt Hibbs

James said:
problems.


Thank you, that is great news.

BTW, what compiler are you using?

I use VC++7.1 (aka Visual Studio .NET 2003). But the one-click installer
includes all required runtime DLLs.

Curt
 

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

Similar Threads

[ANN] Net::SSH 1.0.3 2
[ANN] Net::SSH 2.0.13 Released 0
[ANN] Net::SSH 0.5.0 5
[ANN] Net::SSH 0.1.0 2
[ANN] Net::SSH 1.0.1, Net::SFTP 1.0.0 0
[ANN] Net::SSH 0.0.5 4
[ANN] Net::SSH 0.9.0 7
[ANN] Net::SSH 1.0.7 1

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top