mod_ruby and irb weirdness

N

nmadnani

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
 
C

Csaba Henk

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:

While I am far from being able to give you help, I am interested in your
Matlab wrapper. Could you put it up somewhere? Thanks!

Csaba
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,481
Members
44,900
Latest member
Nell636132

Latest Threads

Top