 |
Forums |
Admin Start New Thread
By: Praveen Devarao
RE: Installing ibm_db gem [ reply ] 2008-12-29 05:03
|
Hi Jorg,
That's right. When you do a sudo the settings in the root account's .bashrc (profile) file comes into effect. Given that your root's .bashrc did not have the IBM_DB_INCLUDE setting you were getting the error. Hence having the env settings in the root's .bashrc you will be able to do a sudo gem install ibm_db without any problems, from your working user account.
---------------------------------------------------
To other users following this forum: -
So here is another point to be noted while installing the ibm_db gem.
- If you are doing a sudo gem install then ensure that the env variables IBM_DB_INCLUDE and IBM_DB_LIB is set appropriately in the root user's account.
The reason why this is required is because when you do sudo the root user's settings is taken up and not the settings made in your working user's account.Hence remember to set the env variables in the root's profile and then go ahead with installing ibm_db gem without any problems.
---------------------------------------------------
Thanks
Praveen
|
By: Jorg Lueke
RE: Installing ibm_db gem [ reply ] 2008-12-28 19:33
|
Hi Praveen,
I had to switch to the actual root user to install the gem rather than to use sudo. But that did work.
I was able to connect to the database and do a db:migrate with rake. However, when I try to access the model via the browser I get an driver load error
/usr/lib/ruby/gems/1.8/gems/ibm_db-1.0.1/lib/active_record/connection_adapters/ibm_db_adapter.rb:97:in `ibm_db_connection'
/usr/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:223:in `send'
I am not sure why the db:migrate would work but the active record connection would fail.
|
By: Praveen Devarao
RE: Installing ibm_db gem [ reply ] 2008-12-28 05:17
|
Hi Jorg,
I am wrong. You are doing a gem install itself and not building the driver manually.
From the log that you have pasted we can make out that the IBM_DB_INCLUDE setting is not recognised by the extconf.rb file. I guess you are doing a sudo gem install ibm_db. If yes, please set the environment variables IBM_DB_INCLUDE and IBM_DB_LIB in your root account [sudo -s] and then try to install. This should work.
Thanks
Praveen
|
By: Praveen Devarao
RE: Installing ibm_db gem [ reply ] 2008-12-28 04:25
|
Hi Jorg,
If I am not wrong, you are trying to build the driver manually right. Could you let me know the complete process that you are following.
Also, which version of the ibm_db gem release are you using. The process illustrated here is applicable from version 1.0.1 of ibm_db gem. If using a lesser version of ibm_db gem then you will require to set the env variable IBM_DB_DIR instead of IBM_DB_INCLUDE to the sqllib directory as below
export IBM_DB_DIR=/home/db2inst1/sqllib
Let me know if you require more info.
Thanks
Praveen
|
By: Jorg Lueke
RE: Installing ibm_db gem [ reply ] 2008-12-27 18:30
|
Unfortunately I get the following error
make
cc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -
g -O2 -fPIC -c ibm_db.c
In file included from ibm_db.c:22:
ruby_ibm_db.h:18:21: error: sqlcli1.h: No such file or directory
In file included from ibm_db.c:22:
ruby_ibm_db.h:182: error: ‘SQL_MAX_MESSAGE_LENGTH’ undeclared here (not in a fun
ction)
My envirpnment variables are as follows and the directories do have the files one would expect
linux:~/Desktop$ echo $IBM_DB_LIB
/home/db2inst1/sqllib/lib
linux:~/Desktop$ echo $IBM_DB_INCLUDE
/home/db2inst1/sqllib/include
and my level
DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09050"
with level identifier "03010107".
Informational tokens are "DB2 v9.5.0.0", "s071001", "LINUXAMD6495", and Fix
Pack "0".
Product is installed at "/opt/ibm/db2exc/V9.5"
|
By: Praveen Devarao
Installing ibm_db gem [ reply ] 2008-12-18 08:50
|
Hi,
Starting from version 1.0.1 of the ibm_db gem, the environment variables required for installing the gem on Linux/Unix/MacOS X have been made clear. The steps to be followed to install the gem on respective platforms as per the new process is below.
1. Linux/Unix/MacOS X Platforms: -
Follow the steps below
Step 1: - Set the Environment variables IBM_DB_INCLUDE and IBM_DB_LIB as below
$ export IBM_DB_INCLUDE=DB2HOME/include (eg. /home/db2inst1/sqllib/include)
$ export IBM_DB_LIB=DB2HOME/lib (eg. /home/db2inst1/sqllib/lib)
Note: -
1) Setting of IBM_DB_LIB is to be done appropriately according to the architecture for which Ruby is compiled. If Ruby is 32-bit then set IBM_DB_LIB to lib32 directory under DB2HOME. If Ruby is 64-bit then set IBM_DB_LIB to lib64 directory under DB2HOME.
2) The lib directory under DB2HOME is a link to either lib32 or lib64 depending on the Architecture for which DB2 is been installed, you can also set the path to lib directory accordingly.
Step 2: - Source the DB2 profile
$ . /home/db2inst1/sqllib/db2profile (optional)
Step 3: - Issue the command gem install ibm_db
$ gem install ibm_db
Select which gem to install for your platform (i686-linux)
1. ibm_db 1.0.1 (mswin32)
2. ibm_db 1.0.1 (ruby)
3. ibm_db 1.0.0 (ruby)
4. ibm_db 1.0.0 (mswin32)
...
Running gem install ibm_db you are presented with two choices for each release(mswin32 or ruby) choose ruby. This will build the native extension (ibm_db driver) and installs the ibm_db gem.
...
> 2
Building native extensions. This could take a while...
Successfully installed ibm_db-1.0.1
Installing ri documentation for ibm_db-1.0..1...
Installing RDoc documentation for ibm_db-1.0.1...
2. Windows: -
No Change.
Continue to install the gem on the Windows platform, as before, by issuing the command ‘gem install ibm_db’.
C:\ gem install ibm_db
Select which gem to install for your platform (i386-mswin32)
1. ibm_db 1.0.1 (mswin32)
2. ibm_db 1.0.1 (ruby)
3. ibm_db 1.0.0 (ruby)
4. ibm_db 1.0.0 (mswin32)
...
Running gem install ibm_db you are presented with two choices for each release
(mswin32 or ruby) choose mswin32.
...
> 1
Successfully installed ibm_db-1.0.1
Installing ri documentation for ibm_db-1.0..1...
Installing RDoc documentation for ibm_db-1.0.1...
-------------------------------------------------
As always, if you are finding any difficulties or have some suggestions or comments feel free write to us.
Thanks
Praveen
|
|
 |