# Mod\_Ruby and Radiant

**URL:** <https://www.ruby-forum.com/t/mod-ruby-and-radiant/130065>\
**Category:** Radiant CMS\
**Created:** [February 25, 2008, 5:20am UTC](https://www.ruby-forum.com/t/mod-ruby-and-radiant/130065 "2008-02-25T05:20:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jack\_Downes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dbc845/32.png) [@Jack\_Downes](https://www.ruby-forum.com/u/Jack_Downes)\
**Post date:** [February 25, 2008, 5:20am UTC](https://www.ruby-forum.com/t/mod-ruby-and-radiant/130065/1 "2008-02-25T05:20:55Z")

</div>

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:in`handler’

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

---

<div class="post-metadata">

**Author:** ![Jack\_Downes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dbc845/32.png) [@Jack\_Downes](https://www.ruby-forum.com/u/Jack_Downes)\
**Post date:** [February 25, 2008, 5:34am UTC](https://www.ruby-forum.com/t/mod-ruby-and-radiant/130065/2 "2008-02-25T05:34:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jack\_Downes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dbc845/32.png) [@Jack\_Downes](https://www.ruby-forum.com/u/Jack_Downes)\
**Post date:** [February 25, 2008, 5:51am UTC](https://www.ruby-forum.com/t/mod-ruby-and-radiant/130065/3 "2008-02-25T05:51:23Z")

</div>

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:in`handler’  
> Anyone know what this is?

thanks,  
Jack

---

<div class="post-metadata">

**Author:** ![Jack\_Downes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dbc845/32.png) [@Jack\_Downes](https://www.ruby-forum.com/u/Jack_Downes)\
**Post date:** [February 25, 2008, 6:20am UTC](https://www.ruby-forum.com/t/mod-ruby-and-radiant/130065/4 "2008-02-25T06:20:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jack\_Downes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dbc845/32.png) [@Jack\_Downes](https://www.ruby-forum.com/u/Jack_Downes)\
**Post date:** [February 25, 2008, 3:42pm UTC](https://www.ruby-forum.com/t/mod-ruby-and-radiant/130065/5 "2008-02-25T15:42:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Jack\_Downes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/dbc845/32.png) [@Jack\_Downes](https://www.ruby-forum.com/u/Jack_Downes)\
**Post date:** [February 25, 2008, 6:41am UTC](https://www.ruby-forum.com/t/mod-ruby-and-radiant/130065/6 "2008-02-25T06:41:14Z")

</div>

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
