Reputation: 3149
I have been using Ruby 1.8 + Rails 2.3.5 with oracle_enhanced and it works fine.
Now I recently installed Ruby 1.9.2 and Rails 3.0.3 on another folder, and I can't get it to work.
When I create a simple application and access it, the page returns the following error:
Please install the oracle_enhanced adapter:
gem install activerecord-oracle_enhanced-adapter
(no such file to load -- active_record/connection_adapters/oracle_enhanced_adapter)
I tried to investigate the problem and found the folder Ruby is using, which is C:\Ruby192\lib\ruby\gems\1.9.1\gems\activerecord-3.0.3\lib\active_record\connection_adapters. In that folder there is no oracle_enhanced_adapter.br file.
The file is in another folder, C:\Ruby192\lib\ruby\gems\1.9.1\gems\activerecord-oracle_enhanced-adapter-1.3.1\lib\active_record\connection_adapters. I tried to copy all rb files from this folder to the other one, I still got an error but it changed:
Please install the oracle_enhanced adapter:
gem install activerecord-oracle_enhanced-adapter
(ERROR: ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. Please install ruby-oci8 gem.)
I noticed that my old Ruby install (1.8) has the same file/folder structure, and oracle_enhanced works.
If I test the connection manually on IRB it works fine, the problem is only with Rails.
Does anyone have a clue?
I'm using Webrick for now, and my gem list is as follows:
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activerecord-oracle_enhanced-adapter (1.3.1)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.6)
builder (2.1.2)
bundler (1.0.7)
cgi_multipart_eof_fix (2.5.0)
erubis (2.6.6)
gem_plugin (0.2.3)
hoe (2.8.0)
i18n (0.5.0)
mail (2.2.13)
mime-types (1.16)
minitest (1.6.0)
mongrel (1.1.5 x86-mingw32)
oracle_enhanced (1.2.5)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
rdoc (2.5.8)
ruby-oci8 (2.0.4 x86-mingw32)
sqlite3-ruby (1.3.2 x86-mingw32)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.23)
Thank you.
Upvotes: 1
Views: 3872
Reputation: 2948
In Rails 3 you have to specify all your gem dependencies in Gemfile. See example of Gemfile with ruby-oci8 and oracle_enhanced adapter: https://github.com/rsim/rails3_oracle_sample/blob/master/Gemfile
After specifying your gem dependencies in Gemfile you need to run bundle install
to ensure that all necessary gems are installed. After that you should be able to use oracle_enhanced adapter.
Upvotes: 3