Oh the pain! Distributing Ruby apps

Hi,

I’ve written some small Ruby apps for monitoring things at work but
am not enjoying distributing them.
Seems for each person I have to install Ruby, then the extra
libraries I use (currently just ori8 and net-ssh). I’d like to write
a gui front end, but shudder at the thought of then having to install
qt / fox / whatever.

Am I missing something here? Do I have to do this for each machine in
order to just let someone else run a Ruby script?

How can I lessen the pain?
Is it possible to install the libraries on the LAN and each machine
run them from there?
I don’t mind installing the Ruby interpreter and I even like Scite
(with modified a ruby proffile :), it’s the extra stuff I’m talking
about.
I’ve tried rubyscript2exe (we’re talking Windows boxes), and it seems
to work fine for some things but breaks the Oracle bindings.

I’ve considered a web app, but I don’t have access to a place to
serve it.

Cheers,
Dave

Sharon P. wrote:

order to just let someone else run a Ruby script?

Cheers,
Dave

I think the tools that Curt H. uses to build and package the
One-Click Ruby Installer and Instant Rails are all open source. I have
no idea what or where they are, but you should be able to track that
down at RubyForge. Since you’re not interested in web apps, I’d
recommend adding your code to the One-Click Ruby Installer and
distributing it that way. Conversely, if you’re building a web app, add
it to Instant Rails. :wink:

Now, if you need to compile C extensions or be cross-platform, I can’t
help you. Maybe Austin Z. has gotten somewhere with his pleas to
Microsoft on compilers for Ruby C extensions, but I haven’t seen that
topic mentioned here recently.

M. Edward (Ed) Borasky wrote:

Microsoft on compilers for Ruby C extensions, but I haven’t seen that
topic mentioned here recently.

I keep forgetting to mention this … I’d like use the One-Click
Installer behind a proxy server. Is there a Ruby tool equivalent to the
Python-based “aps” proxy server?

Sharon P. wrote:

order to just let someone else run a Ruby script?
Actually, ruby doesn’t need any fancy installation on windows to run
code, you just need the interpreter and the libraries your code uses in
a directory structure that mirrors the one the one-click installer
creates. Ie. something like this:

ruby
bin
ruby.exe
msvcrt-ruby18.dll
…other dlls…
lib
ruby
1.8…
site_ruby…

Of course, as long as you don’t associate this ruby.exe with .rb files,
you can’t run those files directly, but you can create a .cmd for each
of your tools, that just does something along the lines of
c:\some\path\ruby\bin\ruby.exe myscript.rb %*
and just tell your users to run that cmd file.

How can I lessen the pain?
Is it possible to install the libraries on the LAN and each machine run
them from there?

You could of course try out putting this directory structure on some
shared disc. As far as I can see, this should work just as well, just
remember that you won’t be able to update an .exe or .dll as long as
some program using it is running.

Hope this helps,
Dennis

On 7/6/07, Sharon P. [email protected] wrote:

Am I missing something here? Do I have to do this for each machine in

I’ve considered a web app, but I don’t have access to a place to
serve it.

Cheers,
Dave

I know of one group that runs some internal ruby apps off of a single
ruby
installation on a shared network drive, so that’s certainly possible. If
you
put your own apps there, that gives you one place to update them too.

Another approach I read about, but haven’t seen tried, is to use JRuby
and
package everything, JRuby, libs plus your app, into one big JAR file,
and
distribute that along with maybe a batch script to execute it. That gets
to
be a big jarfile, but disk space is cheap, and it guarantees that your
app
will keep running on the same version of ruby and other libs that you
tested
it with, even if workstations get upgraded when you aren’t looking.

From: Sharon P. [mailto:[email protected]] :

I’ve written some small Ruby apps for monitoring things at work but

am not enjoying distributing them.

Seems for each person I have to install Ruby, then the extra

libraries I use (currently just ori8 and net-ssh). I’d like to write

argggh, of all db, why oracle?? ora is too big. try postgres (i know
mysql/sqlite, but i am bias for postgres =).

a gui front end, but shudder at the thought of then having to

install qt / fox / whatever.

arggh, first the big db, now a gui?? this will tax your monitored
clients and will skew your observations (mem/cpu/etc); consider
heizenberg principle

Am I missing something here? Do I have to do this for each

machine in order to just let someone else run a Ruby script?

No. you just need the ruby interpreter. If your client script is small,
less than 2k lines, you can load it on the server. The only ruby script
you’ll need then is that script loader.

How can I lessen the pain?

Is it possible to install the libraries on the LAN and each machine

run them from there?

if you need other libs, especially gems, you may load it centrally. they
are quite small.

I don’t mind installing the Ruby interpreter and I even like Scite

(with modified a ruby proffile :), it’s the extra stuff I’m talking

about.

I’ve tried rubyscript2exe (we’re talking Windows boxes), and

it seems

to work fine for some things but breaks the Oracle bindings.

no need. as long as you’re the admin, you can just copy the files on
each pc. And you can automate that using ruby.

I’ve considered a web app, but I don’t have access to a place to

serve it.

a web app, like rails, is less resource hogger than oracle.
if rails is “big” for you, try nitro or iowa or webrick.
run a drb server on the central node, the clients will run drb clients.

to summ:

a. server: running web, db, app, drb server
b. clients: running ruby, rubyscript running drb client
c. drb clients just report the values/data (no gui/image transfers) to
the drb server
d. drb server pipes captured data to the database
e. admin monitors data from db using web app
f. admin manages clients, monitors, schedules, and updates, using web
app
g. admin may trigger realtime monitor on a particular node anytime
(h. if you don’t want drb, you can use http. disadvantage is that only
the client can initiate)

just an idea.

kind regards -botp

hi!

why don’t IBM/Database C, one free DBase small?

tks

— Sharon P. [email protected]
escribió:

your monitored
reasonably complex and busy.
Nothing can be added to the servers. I’m proposing
I don’t have a problem with Rails, but I prefer the
Cheers,
Dave

Jose Manuel Garcia

Licenciado en Administracion
Orientacion Seguros y Reaseguros
Universidad Nacional de La Matanza

Te (011) 4300-0239
Cel (011) 15 52616386

argggh, of all db, why oracle?? ora is too big. try postgres (i
know mysql/sqlite, but i am bias for postgres =).
I’d love to use postgres, and I used to do a lot of work with
Firebird at one stage, but I’m stuck with Oracle. We also use DB2 and
Terradata.

arggh, first the big db, now a gui?? this will tax your monitored
clients and will skew your observations (mem/cpu/etc); consider
heizenberg principle
I work in a classified environment, so I can’t give too much detail
about what I do, so here’s a vague outline:
I work as part of a small team that supports a number of
applications, most of which run on unix boxes. These applications are
reasonably complex and busy.
I’m not interested in CPU or mem usage (we have unicentre and other
dedicated teams to monitor and manage these) but rather specifics
within the system. Can’t give examples. Sorry.
There are times when things break and we have little warning, if any,
but some type of dashboard would have given us the ability to preempt
some of these. That’s what I’m trying to build.
Nothing can be added to the servers. I’m proposing something that
runs on our machines.

a web app, like rails, is less resource hogger than oracle.
if rails is “big” for you, try nitro or iowa or webrick.
run a drb server on the central node, the clients will run drb
clients.
I don’t have a problem with Rails, but I prefer the style of Camping
better. Not much experience (as in close to zero) with either.

Thanks to everyone else for the suggestions too.
I think I’ll have a closer look at JRuby. This seems the best fit
currently, and I understand it can bridge to Java? That would be useful.

Cheers,
Dave

Sharon P. wrote:

some of these. That’s what I’m trying to build.
Nothing can be added to the servers. I’m proposing something that runs
on our machines.

Actually, that helps a lot. Since “nothing can be added to our servers”,
that means you either have to instrument the clients or intercept and
interpret the client-server traffic, right? Since it’s classified, I’ll
go with “instrument the clients”. :slight_smile:

Given that, I think something like Distributed Ruby or Rinda might be a
workable base for this. Or maybe “event machine”?

Thanks to everyone else for the suggestions too.
I think I’ll have a closer look at JRuby. This seems the best fit
currently, and I understand it can bridge to Java? That would be useful.
Yes, jRuby can bridge to Java.

Sharon P. wrote:

Thanks to everyone else for the suggestions too.
I think I’ll have a closer look at JRuby. This seems the best fit
currently, and I understand it can bridge to Java? That would be useful.

Well, JRuby is Java…so it’s not as much a bridge as other solutions.

include Java

import java.lang.System

System.out.println(“foo”)

  • Charlie

On Jul 6, 2007, at 4:14 AM, Sharon P. wrote:

in order to just let someone else run a Ruby script?

How can I lessen the pain?
Is it possible to install the libraries on the LAN and each machine
run them from there?

Try packaging your tools as gems. You can run a gem server of one of
your local boxes to distribute them to the other client machines, and
it makes it simple for pushing updates (with rollback even). Gems can
define the dependencies they need and you can serve these from the
same machine so you don’t have to go outside your network.


Craig B.

AIM: kreiggers

On Windows:
I have a centralized instalation on one of my servers and everything I
have to do is change the system path on workstations:

Choose:
My Computer/Properties/Environment variables/System variables/Path.

Edit Path add
;\serverName\ruby\bin
to the end

You install gems on one WS and it is immediatly available on all WS-s.

I guess something similar can be done on Linux too. Mount some share and
change some system settings.

by
TheR

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs