# \`init': OCI Library Initialization Error (DBI::DatabaseError

**URL:** <https://www.ruby-forum.com/t/init-oci-library-initialization-error-dbi-databaseerror/174070>\
**Category:** Ruby\
**Created:** [August 20, 2009, 11:06am UTC](https://www.ruby-forum.com/t/init-oci-library-initialization-error-dbi-databaseerror/174070 "2009-08-20T11:06:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![namitjain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/e19b73/32.png) [@namitjain](https://www.ruby-forum.com/u/namitjain)\
**Post date:** [August 20, 2009, 11:06am UTC](https://www.ruby-forum.com/t/init-oci-library-initialization-error-dbi-databaseerror/174070/1 "2009-08-20T11:06:31Z")

</div>

Hi All

I tried to connect Oracle with Ruby but on executing the ruby script it  
gave the following error

`init’: OCI Library Initialization Error (DBI::DatabaseError}.

To connect to DB I had the following configuration

Installed Ruby 1.8.6  
I verified that OCI.dll is present in bin folder of Oracle.  
Included oci8.rb in the script.

My test script just uses a single query to get result form the DB.  
Which is  
resultSet1=fireQuery(‘SELECT item\_id FROM item WHERE item\_id  
=?’,4120788)

This script require another rb file that is DBConnect(I have attached  
this file for everyone’s reference)

The error displayed refers to the line no 52 of oci8.rb which is  
"@@env = OCIEnv.init()"I read several documentation but still I am not  
able to figure out where the problem is. Online search showed that  
oraociei10.dll should be present where the oci.dll is present. I did  
this also and copied this dll where the oci.dll is present but still I  
got the same error.

Please let me know where I am going error. Sorry If I am doing some  
fundamental thing wrong, but please help me out.

Please Ask for more information in case I have missed out something.

Any kind of help will be highly appreciated

Thanks  
Namit
