Ruby, Solaris and Oracle drivers

D

Daniel Berger

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: 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top