Alex Fulton wrote:
> Hi, my sincerest apologies if this question has already been answered
> somewhere, but google didn't turn anything up...
> 
> I'm working on a small university research project which is trying to
> create a network weathermap by creating a large distributed P2P network
> of clients installed on ordinary users' home computers, and collecting
> data by running traces etc between the different peers.
> 
> We want to use a high-level language and GUI library for the interface,
> and FXRuby seems to be a good option for this, but, due to the sort of
> computers this client is going to be deployed on (home users,
> predominantly Windows, probably not tech-savvy and reluctant to make any
> changes to their systems), most of them will probably not have a Ruby
> interpreter installed. Rather than forcing people to download Ruby and
> Fox and install them themselves, in addition to installing our client,
> we would prefer to be able to bundle the Ruby interpreter and GUI
> libraries into our application (as dynamic libraries or something) and
> then write most of the program in C (the startup code, the
> communications layer, etc), and only have the user-interaction stuff
> written in Ruby.
> 
> So, is it possible to have a C program that invokes Ruby code via an
> interpreter library? I'm sure I've seen some apps do this with Python,
> but I'm not sure if it's possible with Ruby or not...
> 
> Thanks,
> Alex Fulton
> (Computer Science department, University of Auckland, New Zealand)

see the section "Embedding a Ruby Interpreter" in the pickaxe book and google 
for the same for examples...