Unix command from ruby win32

Hi.

I would like to run a simple command on a remote unix machine from my windows desktop. would this possible in ruby? I would like to run things like a make, ls -l, commands. Has anyone done this before?

"nkb" <nkb@pacific.net.sg> schrieb im Newsbeitrag news:415E8CA9.3060202@pacific.net.sg...

Hi.

I would like to run a simple command on a remote unix machine from my windows desktop. would this possible in ruby? I would like to run things like a make, ls -l, commands. Has anyone done this before?

You'll likely need a Ruby ssh client
http://raa.ruby-lang.org/project/net-ssh/

Then the rest should be easy:
http://net-ssh.rubyforge.org/chapter-4.html

Kind regards

    robert

Robert Klemme wrote:

"nkb" <nkb@pacific.net.sg> schrieb im Newsbeitrag news:415E8CA9.3060202@pacific.net.sg...

Hi.

I would like to run a simple command on a remote unix machine from my windows desktop. would this possible in ruby? I would like to run things like a make, ls -l, commands. Has anyone done this before?

You'll likely need a Ruby ssh client
http://raa.ruby-lang.org/project/net-ssh/

Then the rest should be easy:
http://net-ssh.rubyforge.org/chapter-4.html

I've recently looked into using this shh library on Win2k, but have run into a problem. When running even simple code, I get a message box that tells me, "The ordinal 2586 could not be located in the dynamic link library LIBEAY32.dll"

Does anyone know what causes this error, and how to fix it?

I've seen in the net-ssh docs that the code may need a current version of OpenSSL; I think I have that, running the most recent one-click installer of Ruby 1.8.2 on Windows.

Any ideas?

Thanks,

James Britt

···

Kind regards

   robert

.

James Britt wrote:

I've recently looked into using this shh library on Win2k, but have run into a problem. When running even simple code, I get a message box that tells me, "The ordinal 2586 could not be located in the dynamic link library LIBEAY32.dll"

Does anyone know what causes this error, and how to fix it?

Jamis Buck, who just happens to be sitting in front of me here at
RubyConf2004, has informed me that this is an issue related to
openssl.so on Win32, so investigated a bit.

I found this site
http://www.slproweb.com/products/Win32OpenSSL.html

and installed "Win32 OpenSSL v0.9.7d"

I told the installer to overwrite the existing libs when prompted.

I now get different errors, but they make more sense.

James Brit

James Britt wrote:

Jamis Buck, who just happens to be sitting in front of me here at
RubyConf2004, has informed me that this is an issue related to
openssl.so on Win32, so investigated a bit.

I found this site
Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions

and installed "Win32 OpenSSL v0.9.7d"

I told the installer to overwrite the existing libs when prompted.

I now get different errors, but they make more sense.

But, sadly, this test
ruby -ropenssl -e "p OpenSSL::PKey::DH.instance_method(:g)"

fails, so something is still out of date

···

James Brit

James Britt wrote:

James Britt wrote:

Jamis Buck, who just happens to be sitting in front of me here at
RubyConf2004, has informed me that this is an issue related to
openssl.so on Win32, so investigated a bit.

I found this site
Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions

and installed "Win32 OpenSSL v0.9.7d"

I told the installer to overwrite the existing libs when prompted.

I now get different errors, but they make more sense.

But, sadly, this test
ruby -ropenssl -e "p OpenSSL::PKey::DH.instance_method(:g)"

fails, so something is still out of date

What message do you get when it fails?

What version of Ruby are you using? (You said the one-click installer, so I assume you're using the latest-and-greatest.) And do you have OpenSSL for Ruby installed? Last I heard, it did not come with the one-click installer...

- Jamis

···

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

Jamis Buck wrote:

James Britt wrote:

But, sadly, this test
ruby -ropenssl -e "p OpenSSL::PKey::DH.instance_method(:g)"

fails, so something is still out of date

What message do you get when it fails?

c:\>ruby -ropenssl -e "p OpenSSL::PKey::DH.instance_method(:g)"
-e:1:in `instance_method': undefined method `g' for class `OpenSSL::PKey::DH' (NameError)
         from -e:1

c:\>ruby -v
ruby 1.8.2 (2004-07-29) [i386-mswin32]

What version of Ruby are you using? (You said the one-click installer, so I assume you're using the latest-and-greatest.) And do you have OpenSSL for Ruby installed? Last I heard, it did not come with the one-click installer...

I think it is part of the distro now.

http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/classes/OpenSSL.html

Thanks,

James

I think it is part of the distro now.

http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/classes/OpenSSL.html

Thanks,

James

I've got a working net-ssh on win32, but I had to compile ruby myself.
the oneclick installer do not have a openssl extension compiled.

  The OpenSSL extension is optionally compiled if the ruby configuration system locates OpenSSL headers and libraries. In other words if your OpenSSL files are e.g in c:\openssl, you have to set
INC environment variable like set INC=%INC%;c:\openssl\include and
LIB environment variable liek set LIB=%LIB%;c:\openssl\lib. You also
have to put c:\openssl\lib to PATH environment variable so that dynamic loader can find them when requiring openssl.so. Once these variables are set correctly, you have to compile ruby sources and hopefully ruby openssl extensionis compiled as well.