Ruby 1.8, mod_ruby-1.1.1, and Apache 2

Can anyone point me to a coookbook recipe (or at least some detailed
docs) for how I can build mod_ruby-1.1.1 with Apache 2 using Ruby 1.8?

Is that even possible?

I searched the archives of this mailing list, but I couldn’t find
anything that addresses this combination of packages. I’m hoping that I
overlooked something.

Thanks in advance.

···


Lloyd Zusman
ljz@asfast.com

Is this what you mean?
Server Version: Apache/2.0.46 (Unix) DAV/2 mod_ssl/2.0.46 OpenSSL/0.9.7a
mod_ruby/1.1.1 PHP/4.3.2
Server Built: May 28 2003 22:04:59

If so, I'll be more than happy to post my config files.

···

On Sat, 31 May 2003, Lloyd Zusman wrote:

Can anyone point me to a coookbook recipe (or at least some detailed
docs) for how I can build mod_ruby-1.1.1 with Apache 2 using Ruby 1.8?

Is that even possible?

I searched the archives of this mailing list, but I couldn't find
anything that addresses this combination of packages. I'm hoping that I
overlooked something.

Thanks in advance.

--
Lloyd Zusman
ljz@asfast.com

Is this what you mean?
Server Version: Apache/2.0.46 (Unix) DAV/2 mod_ssl/2.0.46 OpenSSL/0.9.7a
mod_ruby/1.1.1 PHP/4.3.2
Server Built: May 28 2003 22:04:59

If so, I’ll be more than happy to post my config files.

Thank you very much.

Yes, that’s the configuration. I’m encouraged that you got it working.

I don’t know if this is a config file issue or something else. The
problem is that I can’t get mod_ruby-1.1.1 to compile, and I’m wondering
what changes I need to make to either the source code, the configure.rb
script, the Makefile, or whatever.

I configured like this:

./configure.rb --with-apxs=/usr/local/apache2/bin/apxs

But then when I did the make, I immediately got this (I’m manually
wrapping the long lines):

gcc -I/usr/local/include -fPIC -Wall -I/usr/local/include
-I. -I/usr/local/lib/ruby/1.8/i386-freebsd4.0
-I/usr/local/apache2/include -c mod_ruby.c
mod_ruby.c:93: syntax error before *' mod_ruby.c:93: warning: type defaults to int’ in declaration of
ruby_request_queue_mutex' mod_ruby.c:93: warning: data definition has no type or storage class mod_ruby.c:94: syntax error before *’
mod_ruby.c:94: warning: type defaults to int' in declaration of ruby_request_queue_cond’
mod_ruby.c:94: warning: data definition has no type or storage class
[ … more similar syntax errors … ]

It seems like mod_ruby.c is making use of one or more typedefs that
aren’t defined in any of the apache2 include files.

If you want to take this off line, feel free to write to me privately.

Thanks again.

···


Lloyd Zusman
ljz@asfast.com

Lloyd Zusman ljz@asfast.com writes:

Ted Rolle ted@php.net writes:

[ … ]

I don’t know if this is a config file issue or something else. The
problem is that I can’t get mod_ruby-1.1.1 to compile, and I’m wondering
what changes I need to make to either the source code, the configure.rb
script, the Makefile, or whatever.

I configured like this:

./configure.rb --with-apxs=/usr/local/apache2/bin/apxs

But then when I did the make, I immediately got this (I’m manually
wrapping the long lines):

gcc -I/usr/local/include -fPIC -Wall -I/usr/local/include
-I. -I/usr/local/lib/ruby/1.8/i386-freebsd4.0
-I/usr/local/apache2/include -c mod_ruby.c
mod_ruby.c:93: syntax error before `*’
[ … etc. … ]

I found the error. Inside of a few mod_ruby-1.1.1 files there’s the
following preprocessor directive:

#ifdef APR_HAS_THREADS

But in the default build of Apache 2, this variable is set as follows:

#define APR_HAS_THREADS 0

Therefore, I had to change that #ifdef to an #if

#if APR_HAS_THREADS

Now, mod_ruby-1.1.1 builds just fine.

This fix might have to be more sophisticated, because there might be
builds of Apache 2 where APR_HAS_THREADS doesn’t get defined at all. If
so, then there needs to be a combination of #ifdef and #if.

But in any case, attached is the patch that changes this #ifdef to an
#if in all the appropriate places, and which works for me.

Thanks again.

mod_ruby-1.1.1-patch (2.9 KB)

···


Lloyd Zusman
ljz@asfast.com