nmadnani
3/12/2005 1:21:00 AM
Hi Guys
I am having a strange problem with mod_ruby (atleat that's what the
evidence points to). I used SWIG to generate a wrapper around matlab
called 'matlab.so' and placed it in ruby's load path. When I write a
crude test script like this:
require 'matlab'
a=Matlab.init
if (a==0)
puts("Success")
else
puts("fail")
end
So when I run this script on irb, it works fine and I can initialize
Matlab without any problem. But when I embed this in a .rhtml file and
put it on a webserver and try to run it, it keeps failing. It is able
to load 'matlab.so' since I don't see a require error in the apache
error_log but it still fails.
Here is the httpd.conf mod_ruby section:
-------------- httpd.conf -------------------
LoadModule ruby_module libexec/apache/mod_ruby.so
# ClearModuleList
AddModule mod_ruby.c
<IfModule mod_ruby.c>
RubyRequire apache/ruby-run
RubySafeLevel 0
# Excucute files under /ruby as Ruby scripts
<Location /ruby>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Location>
# Execute *.rbx files as Ruby scripts
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
RubyRequire apache/eruby-run
# Handle files under /eruby as eRuby files
<Location /eruby>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Location>
# Handle *.rhtml files as eRuby files
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>
</IfModule>
-------------------------------------
I have no clue why this would happen. The fact that it works fine on
irb tells me that the wrapper shoud be fine. So, could this be a
permissions issue ?
I would appreciate any help or advice that you guys have.
Thanks !
Nitin