Re: using dbi with mod_ruby
jm <[email protected]> Mon, 16 Aug 2004 15:05:49 +1000
| Newsgroups | gmane.comp.apache.mod-ruby |
|---|---|
| Message-ID | <[email protected]> |
Good try, but I'm not using php. Just to check I did a grep -i php
/etc/httpd/conf/httpd.conf and didn't get anything back. Moreover,
$ ldd /usr/local/lib/ruby/site_ruby/1.8/i686-linux/mysql.so
libz.so.1 => /usr/lib/libz.so.1 (0x4003c000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x4004a000)
libnsl.so.1 => /lib/libnsl.so.1 (0x40077000)
libm.so.6 => /lib/tls/libm.so.6 (0x4008c000)
libc.so.6 => /lib/tls/libc.so.6 (0x42000000)
libnss_files.so.2 => /lib/libnss_files.so.2 (0x400af000)
libnss_dns.so.2 => /lib/libnss_dns.so.2 (0x400bb000)
libresolv.so.2 => /lib/libresolv.so.2 (0x400bf000)
libdl.so.2 => /lib/libdl.so.2 (0x400d1000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
Just re-ran the test so I can show people of this list the errors I get,
[Mon Aug 16 14:52:28 2004] [notice] Apache/2.0.40 (Red Hat Linux)
configured -- resuming normal operations
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: error in ruby
[Mon Aug 16 14:52:43 2004] [error] mod_ruby:
/usr/local/lib/ruby/site_ruby/1.8/dbi/sql.rb:152:in `tokens': private
method `scan' called for nil:NilClass (NoMethodError)
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/dbi/sql.rb:206:in `prepare'
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/dbi/sql.rb:181:in `initialize'
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql/Mysql.rb:384:in `new'
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql/Mysql.rb:384:in
`initialize'
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql/Mysql.rb:270:in `new'
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/DBD/Mysql/Mysql.rb:270:in `prepare'
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/dbi/dbi.rb:624:in `prepare'
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/uri_test.rb:37:in `do_sql'
[Mon Aug 16 14:52:43 2004] [error] mod_ruby: from
/usr/local/lib/ruby/site_ruby/1.8/uri_test.rb:21:in `translate_uri'
Jeff.
On 16/08/2004, at 12:57 PM, Shugo Maeda wrote:
> Hi,
>
> jm wrote:
>> Are there any tricks using dbi with mod_ruby? This rather simple
>> example raises an exception on sth.prepare() and the slightly more
>> complicated real code segfaults(11) mod_ruby. Further this code works
>> in irb even with $SAFE=1. Note, database details are fake of course.
>
> You are using PHP, aren't you?
>
> If so, please check the version of libmysqlclient.so linked to mysql.so
> of PHP.
>
> $ ldd /usr/lib/php4/20020429/mysql.so
> libmysqlclient.so.10 => /usr/lib/libmysqlclient.so.10
> (0x40028000)
> ...
>
> Then please check the version of libmysqlclient.os linked to mysql.so
> of
> Ruby.
>
> $ ldd /usr/lib/ruby/1.8/i386-linux/mysql.so
> ...
> libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12
> (0x400ed000)
> ...
>
> If their versions are different, you can't use both mysql.so on the
> same
> Apache instance.
>
> Shugo
>