execute the ruby script remotely

A

Arihan Sinha

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
 
B

Brian Candler

Arihan Sinha 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.
 
R

Rajinder Yadav

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

remote login with ssh comes to mind =)
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top