[Rubygems-developers] packaging binary executables / etc

Patrick May patrick at hexane.org
Sat Feb 19 17:22:51 EST 2005


Hello,

I checked out the x10 Rakefile:

http://rubyforge.org/cgi-bin/viewcvs.cgi/x10-cm17a/ 
Rakefile?rev=HEAD&cvsroot=x10-cm17a&content-type=text/vnd.viewcvs-markup

It is using the spec.extensions property, which doesn't quite fit what  
I am doing.

I'd like to distribute my binary application as a gem.  Is there a hook  
I can use to compile and install this software via gems?  May be I  
could add such a hook -- how should I go about adding this  
functionality to rubygems?

or, is this such a weird example that it is outside the scope of  
rubygems?

> What's led you to distribute a customized ruby interpreter?

You need a web-aware interpreter for cgi-scripts to return errors to  
the browser properly.  The problem is that syntax errors cause ruby to  
exit *before* executing your code.  And syntax errors are very common.   
So, you can build error reporting into methods like:

   cgi.out { ... }

or

   Web::process { ... }

but you won't catch syntax errors like:

   Webprocess{ ... }

For this type of error, ruby will print out an error message that looks  
good in a command shell.  For a cgi script this message is replaced by  
an ugly 500 error from the webserver.  By getting into the interpreter,  
I can send the browser the syntax error, attractively formatted.  PHP  
does a similar thing.  In the windows pre-compiled zips, there is the  
web interpreter and a command line interpreter.

This is what I am looking to deploy with narf.  Sorry if this is a bit  
of an aside, I know this isn't narf-lib-devel at sf.net

Cheers,

Patrick



More information about the Rubygems-developers mailing list