Forum: Ruby on Rails Gem problem with ActiveRecord/Oracle (without rails)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Drew O. (Guest)
on 2007-02-07 16:43
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
Drew O. (Guest)
on 2007-02-07 16:55
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.
Dan M. (Guest)
on 2007-02-07 17:06
(Received via mailing list)
On Feb 7, 9:43 am, Drew O. <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.
Drew O. (Guest)
on 2007-02-07 17:09
Dan M. wrote:
> On Feb 7, 9:43 am, Drew O. <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?
This topic is locked and can not be replied to.