# Gem problem with ActiveRecord/Oracle (without rails)

**URL:** <https://www.ruby-forum.com/t/gem-problem-with-activerecord-oracle-without-rails/84764>\
**Category:** Rails\
**Created:** [February 7, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/gem-problem-with-activerecord-oracle-without-rails/84764 "2007-02-07T15:43:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfg59](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Post date:** [February 7, 2007, 3:43pm UTC](https://www.ruby-forum.com/t/gem-problem-with-activerecord-oracle-without-rails/84764/1 "2007-02-07T15:43:43Z")

</div>

I have written the small script below. I have the ruby-oci adapter  
installed, the newest version of gems and the newest version of  
ActiveRecord. When I run the code I’m getting the follow error following  
my code. It seems to be an issue with gems as far as I can tell. Any  
help?

Thanks,  
Drew

Code:

require ‘ruby\_gems’  
require ‘active\_record’

ActiveRecord::Base::establish\_connection(  
:adapter=\>“oci”,  
:host=\>"\*\*\*",  
:database=\>"\*\*\*",  
:user=\>"\*\*\*",  
:password=\>"\*\*\*")

class Employee \< ActiveRecord::Base  
set\_table\_name “EMPLOYEE”  
end

Employee.find(:all).each do |emp|  
puts emp  
end

Error (OCIError)  
from c:/ruby/lib/ruby/site\_ruby/1.8/oci8.rb:51  
from  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:27:in `ge m_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in`re  
quire’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_suppo  
rt/dependencies.rb:495:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_suppo rt/dependencies.rb:342:in`new\_constants\_in’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_suppo  
rt/dependencies.rb:495:in `require' from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active_suppo rt/core_ext/kernel/requires.rb:7:in`require\_library\_or\_gem’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.4.1/lib/active\_suppo  
rt/core\_ext/kernel/reporting.rb:11:in `silence_warnings' ... 9 levels... from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_recor d.rb:80 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in`ge  
m\_original\_require’  
from  
c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:32:in `re  
quire’  
from models.rb:2

---

<div class="post-metadata">

**Author:** ![dfg59](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Post date:** [February 7, 2007, 3:55pm UTC](https://www.ruby-forum.com/t/gem-problem-with-activerecord-oracle-without-rails/84764/2 "2007-02-07T15:55:03Z")

</div>

Drew O. wrote:

> require ‘ruby\_gems’

This should be, and is in my program, require ‘rubygems’. Slip of the  
finger. Still getting the same error, however.

---

<div class="post-metadata">

**Author:** ![dfg59](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Post date:** [February 7, 2007, 4:06pm UTC](https://www.ruby-forum.com/t/gem-problem-with-activerecord-oracle-without-rails/84764/3 "2007-02-07T16:06:53Z")

</div>

On Feb 7, 9:43 am, Drew O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:32:in `re  
> quire’  
> from models.rb:2

What is in models.rb on line 2?

Dan M.

---

<div class="post-metadata">

**Author:** ![dfg59](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/e0b2c6/32.png) [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Post date:** [February 7, 2007, 4:09pm UTC](https://www.ruby-forum.com/t/gem-problem-with-activerecord-oracle-without-rails/84764/4 "2007-02-07T16:09:06Z")

</div>

Dan M. wrote:

> On Feb 7, 9:43 am, Drew O. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> wrote:
> 
> > c:/ruby/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:32:in `re  
> > quire’  
> > from models.rb:2
> 
> What is in models.rb on line 2?
> 
> Dan M.

Dan -

Line two of models.rb is:

require ‘active\_record’

I’ve never worked with Oracle on this box before. I’m thinking it may be  
that I need to install the Oracle instant client before the ruby oci  
adapter works correctly?
