[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

unix command from ruby win32

nkb

10/2/2004 11:11:00 AM

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?


7 Answers

Robert Klemme

10/2/2004 11:17:00 AM

0


"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/projec...

Then the rest should be easy:
http://net-ssh.rubyforge.org/chap...

Kind regards

robert


James Britt

10/2/2004 7:43:00 PM

0

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/projec...
>
> Then the rest should be easy:
> http://net-ssh.rubyforge.org/chap...

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

10/3/2004 12:19:00 AM

0

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/Win32Op...

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

10/3/2004 1:15:00 AM

0

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
> http://www.slproweb.com/products/Win32Op...
>
> 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
>
>
>
>
>




Jamis Buck

10/3/2004 1:48:00 AM

0

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
>> http://www.slproweb.com/products/Win32Op...
>>
>> 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...


James Britt

10/3/2004 2:52:00 AM

0

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/Op...

Thanks,

James




Ville Mattila

10/3/2004 9:51:00 AM

0

> I think it is part of the distro now.
>
> http://www.ruby-doc.org/stdlib/libdoc/openssl/rdoc/classes/Op...
>
> 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.