Mod_ruby + dbi inconsistency

Hello. I'm running httpd 2.0.49 on Suse 9.1. I've installed mod_ruby
and eruby. I've installed both the dbi and ruby-mysql packages.

Parsing of .rhtml seems to be working fine. However, if I try
anything database related I encounter a problem. I get the following
error in my apache log:

[error] mod_ruby: /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:1:in
`require': No such file to load -- dbi/dbi (LoadError)

However, if I got into IRB I can do the following just fine:

irb(main):001:0> require 'dbi'
=> true
irb(main):002:0> blah=DBI.connect(etc)

And it works.

$> ruby -e " require 'dbi'; dbh=DBI.connect(...) "

Also works. But I get the above error in apache. I thought it had
something to do with the load path when mod_ruby is loaded, so I did a
dump from an rhtml page of $LOAD_PATH, and I get this:

/usr/local/lib/ruby/site_ruby/1.8:/usr/local/lib/ruby/site_ruby/1.8/i686-linux:/usr/local/lib/ruby/site_ruby:/usr/local/lib/ruby/1.8:/usr/local/lib/ruby/1.8/i686-linux:.

dbi is installed in /usr/local/lib/ruby/site_ruby/1.8/dbi, so it would
appear it *should* be loaded just fine.

Any suggestions? Thanks.

Matt

[error] mod_ruby: /usr/local/lib/ruby/site_ruby/1.8/dbi.rb:1:in
`require': No such file to load -- dbi/dbi (LoadError)

I apologize for the noise. It turns out, for some strange reason, the
roots umask was set to 007, not 022 or 002. So it was a permissions
problem.

But, I'm still having issue. Now I get segfaults

[notice] child pid 10449 exit signal Segmentation fault (11)

Whenever I do an sth.execute. I thought it might still be permission
problems, but everything *seems* to be in order ...

Any ideas? I don't normally get segfaults from Ruby. Doing DBI work
with MySQL from irb has 0 problems.

Update:

Since there was an older version of Ruby installed at one point
(1.8.1), I went ahead and deleted everything under:

/usr/lib/ruby
/usr/local/lib/ruby

As well as the compiled binaries:

/usr/bin/ruby, irb, etc

I then recompiled and reinstalled ruby 1.8.2, mod_ruby 1.2.4, eruby
1.0.5, ruby-dbi 0.0.21, and mysql-ruby 2.6.

Same problem. Normal .rhtml stuff works fine. I can even do this:

require 'dbi'
dbh = DBI.connect('DBI:Mysql:mydb', 'user', 'psswd')
sth = dbh.prepare( "SELECT * FROM foo" )

But the moment I do a `sth.execute` then I get a segfault error in my
apache error log.

And, still, dbi/mysql works fine from IRB. UGH.