Ruby-Postgres problems

All,

I’m having problems running the Ruby-Postgres extension, and am looking for
any suggestions anyone may have:

After some initial trouble getting extconf.rb to find libpq, I suceeded
creating the Makefile:

iusris@codedbliss[~/src/ruby-postgres-0.6.5] ruby extconf.rb
checking for cygwin32_socket() in -lwsock32… no
checking for socket() in -lsocket… no
checking for gethostbyname() in -linet… no
checking for gethostbyname() in -lnsl… yes
checking for sys/un.h… yes
checking for socket()… yes
checking for hsterror()… no
checking for gethostname()… yes
checking for PQsetdbLogin() in -lpq… yes
checking for PQsetClientEncoding()… yes
checking for pg_encoding_to_char()… no
creating Makefile

The rest of the process seems to work as well:
iusris@codedbliss[~/src/ruby-postgres-0.6.5] make
gcc -shared -L/usr/lib/ruby/1.6/i686-linux-gnu -L/usr/lib -o postgres.so
-lpq -lnsl -lc

root@codedbliss[/home/iusris/src/ruby-postgres-0.6.5] make install
postgres.so -> /usr/lib/ruby/1.6/i686-linux-gnu/postgres.so
chmod 0555 /usr/lib/ruby/1.6/i686-linux-gnu/postgres.so

Then I noticed that there was very little to celebrate:

irb(main):001:0> require 'postgres’
LoadError: (null) - /usr/lib/ruby/1.6/i686-linux-gnu/postgres.so
from (irb):1:in `require’
from (irb):1

Checking ldd, I think everything is linking how it should be (according to
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/24897):

root@codedbliss[/usr/local/pgsql/lib] ldd
/usr/lib/ruby/1.6/i686-linux-gnu/postgres.so
libpq.so.2 => /usr/local/pgsql/lib/libpq.so.2 (0x40013000)
libnsl.so.1 => /lib/libnsl.so.1 (0x40023000)
libc.so.6 => /lib/libc.so.6 (0x40039000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0x4015e000)
libresolv.so.2 => /lib/libresolv.so.2 (0x4018b000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

… so what’s the LoadError caused by?

#My Configuration

  • Postgresql-7.2.2
  • Ruby 1.6.7 (2002-03-01) [i686-linux-gnu]
  • Gentoo Linux

Many thanks to anyone, in advance, that can help me try to resolve this
problem.

  • B
···


Bruce Williams http://www.codedbliss.com
/// bruce@codedbliss.com
Vision without action is a daydream.
Action without vision is a nightmare.
– japanese proverb