Execute the ruby script remotely

Hi All,

I am trying to do something like

ruby is installed in system1, and system2.

I am at system1.

I want to connect to system2, then invoke ruby and execute a ruby
script.

say I’ve a sample script in system2 as sample.rb.

I want to run that from system1.

Please let me know how I would do that.

Regards
Arihan

Arihan S. wrote in post #955864:

ruby is installed in system1, and system2.

I am at system1.

I want to connect to system2, then invoke ruby and execute a ruby
script.

say I’ve a sample script in system2 as sample.rb.

I want to run that from system1.

Please let me know how I would do that.

Look into ssh.

You can run the ssh client directly it using system [vlad does this], or
you can use the Net::SSH gem [capistrano does this]

Of course, you need a working ssh daemon on system2. With Unix/Linux
you’ll have this out of the box. For Windows look at installing cygwin.

ssh is well tested and secure.

Less secure alternative: write your script sample.rb on system 2 such
that it waits for a connection on a TCP socket and then does its stuff.
The class GServer in the standard library may help you, or read up on
DRb.

On Wed, Oct 20, 2010 at 2:21 PM, Arihan S. [email protected]
wrote:

say I’ve a sample script in system2 as sample.rb.

I want to run that from system1.

Please let me know how I would do that.

Regards
Arihan

remote login with ssh comes to mind =)