How to connect to a DB2 database

haven't tried it but will it help if you remove the last "/" ?

some scripts balks on simple typos esp on windows..

···

Victor Reyes [mailto:victor.reyes@gmail.com] wrote:

C:\$user\ruby\ruby-db2-0.4>set DB2DIR=C:/db2/SQLLIB/

I tried it without the "/" with the same result.

C:\$user\ruby\ruby-db2-0.4>set DB2DIR=C:/db2/SQLLIB
C:\$user\ruby\ruby-db2-0.4> ruby setup.rb config
setup.rb:714: warning: don't put space before argument parentheses
entering config phase...
config done.

C:\$user\ruby\ruby-db2-0.4> ruby setup.rb setup
setup.rb:714: warning: don't put space before argument parentheses
entering setup phase...
C:/Ruby/bin/ruby extconf.rb
checking for SQLConnect() in db2cli.lib... 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)
setup failed
'system C:/Ruby/bin/ruby extconf.rb' failed
try "ruby setup.rb --help" for usage

C:\$user\ruby\ruby-db2-0.4>

Thanks,

Victor

···

On Fri, 29 Oct 2004 12:43:13 +0900, Peña, Botp <botp@delmonte-phil.com> wrote:

Victor Reyes [mailto:victor.reyes@gmail.com] wrote:
> C:\$user\ruby\ruby-db2-0.4>set DB2DIR=C:/db2/SQLLIB/

haven't tried it but will it help if you remove the last "/" ?

some scripts balks on simple typos esp on windows..

BTW, which version of Ruby do you use (and which DB2)?.

Please have a look at ruby-db2-0.4\ext\db2\extconf.rb

Replace it with:

  require "mkmf"

  DB2LIB = "db2cli"
  DB2DIR = "C:/db2/SQLLIB"

  dir_config( "db2", DB2DIR + "/include", DB2DIR + "/lib" )

  if have_header("sqlcli.h") and have_library(DB2LIB, "SQLConnect")
    create_makefile "db2cli"
  else
    raise "abort"
  end

Then try running "ruby extconf.rb" alone. Look at C:/db2/SQLLIB/lib for
a db2cli.XXX file... play a bit with the paths (e.g. try
"C:\\db2\\SQLLIB\\lib" etc.)...

Regards,

  Michael

···

On Sat, Oct 30, 2004 at 09:35:00PM +0900, Victor Reyes wrote:

I tried it without the "/" with the same result.

C:\$user\ruby\ruby-db2-0.4>set DB2DIR=C:/db2/SQLLIB
C:\$user\ruby\ruby-db2-0.4> ruby setup.rb config
setup.rb:714: warning: don't put space before argument parentheses
entering config phase...
config done.

C:\$user\ruby\ruby-db2-0.4> ruby setup.rb setup
setup.rb:714: warning: don't put space before argument parentheses
entering setup phase...
C:/Ruby/bin/ruby extconf.rb
checking for SQLConnect() in db2cli.lib... 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)
setup failed
'system C:/Ruby/bin/ruby extconf.rb' failed
try "ruby setup.rb --help" for usage

C:\$user\ruby\ruby-db2-0.4>