[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: How to connect to a DB2 database.

Peña, Botp

10/29/2004 3:43:00 AM

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


2 Answers

Victor Reyes

10/30/2004 12:35:00 PM

0

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



Michael Neumann

10/30/2004 12:51:00 PM

0

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>

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