Hi Ray,
thanks for your time. See below for all the answers.
On Dec 15, 10:41 pm, Raimonds Simanovskis
<
raimonds.simanovs...@gmail.com> wrote:
> 1. Do you have just Ruby Enterprise Edition on this computer? No
> original MRI? (Just wanted to be sure that there are no conflicts
> between different Ruby installations)
I thought this could be the problem. I had ruby-1.8 and ruby-1.9
installed but removed them and the problem still persists.
> 2. It seems that there are some issues with oci8 installation if you
> got "no such file to load" issue. Have you compiled and installed ruby-
> oci8 library or have you installed it with "gem install ruby-oci8"?
> If you have installed as gem then try
> require ‘rubygems’
> gem ‘ruby-oci8’
> require 'oci8'
> OCI8.new('user', 'password', 'database').exec('select * from dual') do
> |r| puts r.join(','); end
>
> if successful it sho1uld return X from this select.
$ /opt/ruby/bin/ruby <<EOF
require 'rubygems'
gem 'ruby-oci8'
require 'oci8'
OCI8.new('u', 'p', 'db').exec('select * from dual') do |r| puts r.join
(','); end
EOF
X
> 2. Is activerecord-oracle_enhanced-adapter installed?
> gem list activerecord-oracle_enhanced-adapter
yes, it's there:
activerecord-oracle_enhanced-adapter (1.1.8)
> 3. Verify that activerecord-oracle_enhanced-adapter is working from
> irb:
>
> require ‘rubygems’
> gem ‘activerecord’
> gem ‘activerecord-oracle_enhanced-adapter’
> require ‘activerecord’
> ActiveRecord::Base.establish_connection(:adapter => “oracle_enhanced”,
> :database => “database”,:username => “user”,:password => “password”)
$ /opt/ruby/bin/irb
>> require 'rubygems'
=> false
>> gem 'activerecord'
=> true
>> gem 'activerecord-oracle_enhanced-adapter'
=> true
>> require 'activerecord'
=> true
>> ActiveRecord::Base.establish_connection(:adapter => "oracle_enhanced", :database => "db", :username => "u", :password => "p")
=> #<ActiveRecord::Base::ConnectionSpecification:0x99518f8
@adapter_method="oracle_enhanced_connection", @config=
{:database=>"db", :username=>"u", :adapter=>"oracle_enhanced", :password=>"p"}
>> class Tester < ActiveRecord::Base
>> set_table_name('dual')
>> end
=> nil
>> Tester.find_by_sql('select sysdate as d from dual')[0].d
=> Tue Dec 16 15:44:42 0900 2008
> and see if it is successful (use your correct database, username and
> password)
>
> As I understand your previous post is related to the same issue?
not really (as far as I understand), Rails was complaining about that.
To work it around I installed the gem in the Rails tree (using rails
2.2.0 and rake gems:install) and added the definition as outlined in
my previous post.
Thanks
-- mattia