On 07/01/2008, James Dinkel <jdinkel / bucoks.com> wrote:
> Here is a forum post that tells you how to embed ruby script into
> webpages just like php does.  This uses mod_ruby and eruby.  It's
> basically just apt install a couple packages and then add some Apache
> configuration.
>
> http://ubuntuforums.org/showthread.php?t=356350
>
> Read all the way through it as I think the configuration in the last
> post is the best version.  But I have not tried this myself yet, but it
> looks like it is all legit and nothing stupid or extraneous is being
> done.
>
> This is not much different than mod_php.  Really, the only difference is
> that the mod_php install takes care of the apache configuration for you.
> I just wish that the mod_ruby installation did the same thing.  Just
> install mod_ruby and the apache configuration would be taken care of.
> Really all it would need is one file added to the deb installation
> package.  But for the time being, I guess at least it is possible to do.

I suggest you stay away from mod_ruby because it is not as clean as it
should. The 1.8 interpreter cannot be reset, and as Apache reuses
processes some stuff may leak from one script into another. Using with
the multithreaded Apache also won't be a big win as multiple Ruby
threads cannot run concurrently. You probably can't even create
multiple threads running  ruby safely (as opposed to creating multiple
ruby threads inside one native thread of execution as is done in the
interpreter). You can use ruby as cgi scripts or with Mongrel or
something but mod_ruby is not the right way.

Thanks

Michal