Monday, December 20, 2010

Install ibm_db gem on Cygwin 1.7 on Windows 7

Just got a brand new Windows 7 laptop. Had troubles in installation of ibm_db gem.

Here is the configuration

* Windows 7 64bit
* Cygwin 1.7.7-1
* DB2 Express-C 64bit v9.72 (db2exc_972_WIN_x86_64.exe)
* Cygwin Ruby 1.8.6
* Bash

Here are the steps how to install ibm_db:

* copy c:\Program Files\IBM\SQLLIB\lib\Win32\db2cli.lib to db2.lib
* export IBM_DB_LIB=/cygdrive/c/Program\ Files/IBM/SQLLIB/lib/Win32
* export IBM_DB_INCLUDE=/cygdrive/c/Program\ Files/IBM/SQLLIB/include
* gem install ibm_db

NOTEs:
* Because the ruby of Cygwin is still 32bit, you have to link to 32bit library.
* the native extension build uses "-ldb2", which means db2cli.lib is not recognized.
* w32api package in Cygwin (not sure if it is needed, may be not)

No comments:

Post a Comment