Mod_Ruby and Radiant

Anyone have radiant running on mod_ruby?

I have only one site on my xen-based server and I just want to run
radiat without Mongrel and some proxy mess and/or the fastcgi stuff.
I have a simple helloworld.rb script running and showing “Hello World!”
just fine, however, when I try to run the radiant scripts I end up with
a few errors…
Here’s the working helloworld.rb script just for reference:

Create a new object

g = Greeter.new(“world”)

Output “Hello World!”

g.salute
here is my .htaccess

Example:

RewriteEngine On
RewriteRule ^$ index.html [QSA]

ErrorDocument 500 “

Application error

Rails application failed
to start properly”
This is the error I get at the domain…
Application error

Rails application failed to start properly

and the errors in the error.log each time I try to access the radiant
app:

[Sun Feb 24 21:15:26 2008] [error] mod_ruby: from
[Sun Feb 24 21:15:26 2008] [error] mod_ruby: from
load' [Sun Feb 24 21:15:26 2008] [error] mod_ruby: from /usr/lib/ruby/1.8/apache/ruby-run.rb:53:inhandler’

Here’s the Vhost entry:

            php_admin_value open_basedir 

index.html index.php4


As you can see, I use mod_sql loggin, and mod_php5. I assume these will
cause me some issues in the future, but I’ll cross that bridge when I
get there.

anyway, I just want to see the radiant app come up.

Any assistance is welcome, and if this is inappropriate to put this much
information into the email, please let me know, I won’t do it again…
I just hope I got enough information here to kinda help debug.

thanks,
Jack

I’m trying to decrease the RubySafeLevel… that is the first error,
all the others are just part of the cascade, so that might just be it.

Jack

Okay, I recompiled the mod_ruby source such that i turned the SAFE const
to 0, and … well, got a different error:

[Sun Feb 24 21:49:18 2008] [error] mod_ruby: from
/usr/lib/ruby/1.8/apache/ruby-run.rb:53:in load' [Sun Feb 24 21:49:18 2008] [error] mod_ruby: from /usr/lib/ruby/1.8/apache/ruby-run.rb:53:inhandler’
Anyone know what this is?

thanks,
Jack

Allright, I seem to have a working radiant CMS… can change files in
admin, publish, etc all as expected and actually pretty fast… So,
good.

To recap, I had to recompile the mod_ruby source and change one line in
mod_ruby.h from
#define MR_DEFAULT_SAFE_LEVEL 1
to
#define MR_DEFAULT_SAFE_LEVEL 0

and my .htaccess now looks like this:

#require “/var/lib/gems/1.8/gems/rails-2.0.2/lib/dispatcher”

#ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if
File.directory?(dir) } if defined?(Apache::RubyRun)
Dispatcher.dispatch
I have very little understanding of what’s going on here… perhaps
someone with some experience can tell my why this work and why i had to
comment out the ADDITIONAL line, etc.

thanks,
Jack

this seems to be working fine now, no strange Application Errors or
anything any more. Sorry for spamming your list with my woes and then
solving before any response, who knows, maybe it’ll help someone else.
If you want a copy of my config files again, let me know, I’ll email you
directly.

Jack

Okay, this isn’t a solid solution… it throws these errors quite often
while in the admin:

Application error (Apache)

Change this error message for exceptions thrown outside of an action
(like in Dispatcher setups or broken Ruby code) in public/500.html

This error comes from mod_ruby I think… not sure though. It also
will show up if I hit reload rapidly while trying to view the site.

I guess I’ll have to give fastcgi a shot again. too bad, I’d sure love
to ahve a useful setup with mod_ruby, but I guess it’s not that big a
deal.

Jack