kubo / ruby-oci8

Ruby-oci8 - Oracle interface for ruby
Other
169 stars 75 forks source link

ERROR: ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. Please install ruby-oci8 gem #40

Closed alexvaigm closed 11 years ago

alexvaigm commented 11 years ago

I installed new rails app with oracle database I have installed rails v4, ruby v2, ruby-oci8 v2.1.5

I am working on Win7 64bit

When I starting rails server I am getting error:

ERROR: ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. Please install ruby-oci8 gem

kubo commented 11 years ago

Does the following command work?

ruby -e "require 'oci8'"

If it works, could you add "(#$!)" to the error message in oracle_enhanced_oci_connection.rb as follows and kick rails server again?

begin
  require "oci8"
rescue LoadError
  # OCI8 driver is unavailable.
  raise LoadError, "ERROR: ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. Please install ruby-oci8 gem. (#$!)"
end
alexvaigm commented 11 years ago

after I added like you said I got:

LoadError (ERROR: ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. Please install ruby-oci8 gem. (cannot load such file -- oci8)):

kubo commented 11 years ago

ruby -e "require 'oci8'" raised no error and require 'oci8' in rails server raised 'cannot load such file -- oci8'. It is correct?

If so, ruby in command line and ruby used by rails may have different $LOAD_PATH. Could you post the output of the following commands?

gem list
bundle list
alexvaigm commented 11 years ago

yes , it is correct.

my Gemfile starting with:

source 'https://rubygems.org' gem 'rails', '4.0.0' gem 'ruby-oci8' gem 'activerecord-oracle_enhanced-adapter'


The output is:

c:\RubyProjects\INFO>gem list

* LOCAL GEMS *

actionmailer (4.0.0) actionpack (4.0.0) activemodel (4.0.0) activerecord (4.0.0) activerecord-deprecated_finders (1.0.3) activerecord-oracle_enhanced-adapter (1.4.2, 1.3.2) activesupport (4.0.0) arel (4.0.0) atomic (1.1.10) bigdecimal (1.2.1, 1.2.0) builder (3.2.2, 3.1.4) bundler (1.3.5) coffee-rails (4.0.0) coffee-script (2.2.0) coffee-script-source (1.6.3) erubis (2.7.0) execjs (1.4.0) hike (1.2.3) i18n (0.6.4) io-console (0.4.2) jbuilder (1.5.0) jquery-rails (3.0.4) json (1.8.0, 1.7.7) mail (2.5.4) mime-types (1.23) minitest (5.0.6, 4.7.5, 4.3.2) multi_json (1.7.7) polyglot (0.3.3) psych (2.0.0) rack (1.5.2) rack-test (0.6.2) rails (4.0.0) railties (4.0.0) rake (10.1.0, 0.9.6) rdoc (4.0.1, 4.0.0, 3.12.2) ruby-oci8 (2.1.5.1 x64-mingw32) rubygems-update (2.0.6) sass (3.2.10) sass-rails (4.0.0) sdoc (0.3.20) sprockets (2.10.0) sprockets-rails (2.0.0) test-unit (2.5.5, 2.0.0.0) thor (0.18.1) thread_safe (0.1.2) tilt (1.4.1) treetop (1.4.14) turbolinks (1.3.0) tzinfo (1.0.1, 0.3.37) uglifier (2.1.2)


c:\RubyProjects\INFO>bundle list Gems included by the bundle:

alexvaigm commented 11 years ago

I managed to overcome the error "cannot load such file -- oci8", by compiling ruby-oci8-2.1.5 source using make and make install

now I have a new error:

undefined method arel_attributes_values' for classActiveRecord::Base'

kubo commented 11 years ago

I'll close this issue because the new error isn't related to ruby-oci8. It is filed as an oracle_enhanced adapter issue. See rsim/oracle-enhanced#312.

alexvaigm commented 11 years ago

Thanks for the help