Re: DB2 Driver on RHEL 4 x86_64


#1

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

Is your Ruby 32 or 64 bit (i.e. what does (2**32).class return)? Was
the underlying DB2 library built as 32 or 64 bit?

My initial guess is that you’re trying to link a 64 bit Ruby against a
32 bit DB2 or vice-versa.

Try compiling the following program with “gcc -m64 -ldb2 -o foo foo.c”
and “gcc -m32 -ldb2 -o foo foo.c” and see what happens:

/* foo.c */
int main(){ return 0; }

Regards,

Dan


#2

When I enter ruby -version I get:
ruby 1.8.4 (2005-12-24) [x86_64-linux]

I installed ruby from source using whatever compiler is on RHEL AS 4

I’m not trying to compile the program myself; I’m just using the
setup.rb file… no clue how to compile manually…


#3

Oh, and 2**32 returns Fixnum on my x86_64 box.

Thanks in advance for your help… Mustn’t be a lot of people using
Ruby with DB2…


#4

Costas wrote:

Oh, and 2**32 returns Fixnum on my x86_64 box.

You’ve got a 64 bit Ruby then.

Thanks in advance for your help… Mustn’t be a lot of people using
Ruby with DB2…

What happened when you tried to compile that C program that I mentioned?

Regards,

Dan


#5

I’m using Ruby with DB2. But I’m using the ODBC interface rather than
the native DB2 libraries. It works great, no hassles.


#6

I get this:

/usr/bin/ld: cannot find -ldb2
collect2: ld returned 1 exit status