Ruby 1.8.1 (64 bit)
Oracle 9.2 (64 bit)
$ORACLE_HOME = /opt/oracle>file
/opt/bin/ruby: ELF 64-bit MSB executable SPARCV9 Version 1,
UltraSPARC1 Extensions Required, dynamically linked, not stripped
/opt/oracle/lib/libclntsh.so: ELF 64-bit MSB dynamic lib SPARCV9
Version 1, dynamically linked, not stripped
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:
dbh = DBI.connect(dsn,user,passwd)
sth = dbh.prepare(“select sysdate from dual”)
rec = sth.fetch
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).
Hand edit Makefile and add “-R/opt/oracle/lib” to the DLDFLAGS option.
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:
/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
LD_LIBRARY_PATH is NOT set
Hand edit Makefile and add “-R/opt/oracle/lib” to the DLDFLAGS option
Copied Ruby9i.rb to /opt/lib/ruby/site_ruby/1.8/DBD/Ruby9i
prepare': undefined methodses_h’ for #Ruby9i::Database:0x100229e38
from /opt/lib/ruby/site_ruby/1.8/dbi/dbi.rb:615:in `prepare’
Did I install the DBD incorrectly? Or is there an issue with the
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.