Hi all,

Ruby 1.8.1 (64 bit)
Solaris 9
Oracle 9.2 (64 bit)
$ORACLE_HOME = /opt/oracle>file
Solaris ld

Additional info:

>file /opt/bin/ruby
/opt/bin/ruby:  ELF 64-bit MSB executable SPARCV9 Version 1,
UltraSPARC1 Extensions Required, dynamically linked, not stripped

>file /opt/oracle/lib/libclntsh.so
/opt/oracle/lib/libclntsh.so:   ELF 64-bit MSB dynamic lib SPARCV9
Version 1, dynamically linked, not stripped

>ld -V
ld: Software Generation Utilities - Solaris Link Editors: 5.9-1.343

I'm having some issues with the various Oracle drivers - namely
Yoshida Masato's Oracle driver and Jim Cain's Ruby9i driver.  I'll
also mention the OCI8 driver where appropriate.  As a test program, I
used this simple script:

# dbitest.rb
require "dbi"
dbh = DBI.connect(dsn,user,passwd)
sth = dbh.prepare("select sysdate from dual")
sth.execute
rec = sth.fetch
p rec
sth.finish
dbh.disconnect
# end

First, I want to be able to build and use these drivers without
relying on the LD_LIBRARY_PATH.  Let's start with Yoshida Masato's
Oracle driver.  Note that if I don't add the -R option (below) it will
die with an ld error if LD_LIBRARY_PATH isn't set.

LD_LIBRARY_PATH is NOT set (on purpose).
ruby extconf.rb
Hand edit Makefile and add "-R/opt/oracle/lib" to the DLDFLAGS option.
make
make site-install

A quick check on the command line using "ruby -r oracle -e 0" reveals
no problem.  But, when I run dbitest.rb, I get this:

>ruby dbitest.rb
/opt/lib/ruby/site_ruby/1.8/DBD/Oracle/Oracle.rb:86: [BUG] Bus Error
ruby 1.8.1 (2003-12-25) [sparc-solaris2.9]

Abort (core dumped)
---------

On to Ruby9i (0.2.1 with patch by Paul Williams).  I follow the same
steps:

LD_LIBRARY_PATH is NOT set
ruby extconf.rb
Hand edit Makefile and add "-R/opt/oracle/lib" to the DLDFLAGS option
make
make site-install
Copied Ruby9i.rb to /opt/lib/ruby/site_ruby/1.8/DBD/Ruby9i

>ruby dbitest.rb
/opt/lib/ruby/site_ruby/1.8/DBD/Ruby9i/Ruby9i.rb:48:in `prepare':
undefined method `ses_h' for #<Ruby9i::Database:0x100229e38>
(NoMethodError)
        from /opt/lib/ruby/site_ruby/1.8/dbi/dbi.rb:615:in `prepare'
        from dbitest.rb:16

Did I install the DBD incorrectly?  Or is there an issue with the
driver?

-------

The ruby-oci8 driver, however, appears to work flawlessly.  I didn't
have to edit the Makefile and yet it works without having
LD_LIBRARY_PATH set.  So, what did OCI8 do right that the other two
did wrong?  That, or what am *I* doing wrong?

Quick aside - is there a way to set the runtime path with mkmf?

Any and all help appreciated.

Regards,

Dan