Oh the pain! Distributing Ruby apps

  • Thread starter Sharon Phillips
  • Start date
S

Sharon Phillips

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
 
M

M. Edward (Ed) Borasky

Sharon said:
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

I think the tools that Curt Hibbs 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. ;)

Now, if you need to compile C extensions or be cross-platform, I can't
help you. Maybe Austin Ziegler 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

M. Edward (Ed) Borasky

M. Edward (Ed) Borasky said:
I think the tools that Curt Hibbs 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. ;)

Now, if you need to compile C extensions or be cross-platform, I can't
help you. Maybe Austin Ziegler has gotten somewhere with his pleas to
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?
 
D

Dennis Ranke

Sharon said:
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?

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
 
P

Peña, Botp

From: Sharon Phillips [mailto:p[email protected]] :
# I've written some small Ruby apps for monitoring things at work but =20
# am not enjoying distributing them.
# Seems for each person I have to install Ruby, then the extra =20
# libraries I use (currently just ori8 and net-ssh). I'd like to write =20

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

# a gui front end, but shudder at the thought of then having to=20
# 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=20
# 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 =20
# 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 =20
# (with modified a ruby proffile :), it's the extra stuff I'm talking =20
# about.
# I've tried rubyscript2exe (we're talking Windows boxes), and=20
# it seems =20
# 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.

=20
# I've considered a web app, but I don't have access to a place to =20
# 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
 
S

Sharon Phillips

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
 
M

M. Edward (Ed) Borasky

Sharon said:
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.

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". :)

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.
 
C

Charles Oliver Nutter

Sharon said:
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
 
C

Craig Beck

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?

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.
 
D

Damjan Rems

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
 

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,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top