# DB2 Driver on RHEL 4 x86\_64

**URL:** <https://www.ruby-forum.com/t/db2-driver-on-rhel-4-x86-64/70952>\
**Category:** Ruby\
**Created:** [February 20, 2006, 8:14pm UTC](https://www.ruby-forum.com/t/db2-driver-on-rhel-4-x86-64/70952 "2006-02-20T20:14:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Costas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@Costas](https://www.ruby-forum.com/u/Costas)\
**Post date:** [February 20, 2006, 8:14pm UTC](https://www.ruby-forum.com/t/db2-driver-on-rhel-4-x86-64/70952/1 "2006-02-20T20:14:31Z")

</div>

Having some trouble getting the Ruby/DB2 Driver going on my x86\_64  
box…

FWIW, I’m using DB2 8.1, and have set DB2DIR=/opt/IBM/db2/V8.1 ; I’m  
pretty sure the path is correct, and I’m installing as root.

I’m trying to install from ruby-db2-0.4.4

ruby setup.rb config  
setup.rb:714: warning: don’t put space before argument parentheses  
entering config phase…  
config done.

Runs perfectly. However it pukes when I run:

ruby setup.rb setup

setup.rb:714: warning: don’t put space before argument parentheses  
entering setup phase…  
/usr/local/bin/ruby extconf.rb  
checking for SQLConnect() in -ldb2… no  
ABORT: Could not locate DB2 libraries or headers!  
Please set DB2DIR to your DB2 directory, e.g. /usr/IBMdb2/V7.1 (UNIX)  
or C:/SQLLIB (Windows)  
\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

mkmf.log:

have\_library: checking for SQLConnect() in -ldb2…  
-------------------- no

“gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/x86\_64-linux  
-I/opt/IBM/db2/V8.1/include -g -O2 conftest.c  
-L’/opt/IBM/db2/V8.1/lib’ -Wl,-R’/opt/IBM/db2/V8.1/lib’  
-L’/usr/local/lib’ -Wl,-R’/usr/local/lib’ -lruby-static -ldb2  
-ldl -lcrypt -lm -lc”  
/usr/bin/ld: skipping incompatible /opt/IBM/db2/V8.1/lib/libdb2.so when  
searching for -ldb2  
/usr/bin/ld: cannot find -ldb2  
collect2: ld returned 1 exit status  
checked program was:  
/\* begin \*/

/_top_/  
int main() { return 0; }  
int t() { SQLConnect(); return 0; }  
/\* end \*/

“gcc -o conftest -I. -I/usr/local/lib/ruby/1.8/x86\_64-linux  
-I/opt/IBM/db2/V8.1/include -g -O2 conftest.c  
-L’/opt/IBM/db2/V8.1/lib’ -Wl,-R’/opt/IBM/db2/V8.1/lib’  
-L’/usr/local/lib’ -Wl,-R’/usr/local/lib’ -lruby-static -ldb2  
-ldl -lcrypt -lm -lc”  
conftest.c: In function `t': conftest.c:5: error:`SQLConnect’ undeclared (first use in this  
function)  
conftest.c:5: error: (Each undeclared identifier is reported only once  
conftest.c:5: error: for each function it appears in.)  
checked program was:  
/\* begin \*/

/_top_/  
int main() { return 0; }  
int t() { void ((_volatile p)()); p = (void ((_)()))SQLConnect; return  
0; }  
/\* end \*/

---

<div class="post-metadata">

**Author:** ![Costas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@Costas](https://www.ruby-forum.com/u/Costas)\
**Post date:** [February 22, 2006, 1:33am UTC](https://www.ruby-forum.com/t/db2-driver-on-rhel-4-x86-64/70952/2 "2006-02-22T01:33:52Z")

</div>

If anyone cares, I figured it out…

Apparently the installer doesn’t look in DB2’s lib64 directory. I  
symlinked DB2’s lib folder to lib64 and it installed fine.

I feel like suck a dunce for not seeing that. Thanks again for your  
help.
