[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

mod_ruby and irb weirdness

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

1 Answer

Csaba Henk

3/12/2005 9:40:00 PM

0

On 2005-03-12, nmadnani@gmail.com <nmadnani@gmail.com> wrote:
> 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