简体   繁体   中英

Invoking active_record error - can not load file in Ruby on Rails

When I try to run rails generate scaffold test the following error always shows

C:\Lab\railapps\dbtest>rails generate scaffold test
      invoke  active_record
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `require': Please install the oracle_enhanced_adapter: `gem install activerecord-oracle_enhanced-adapter` (cannot load such file -- active_record/connection_adapters/oracle_enhanced_adapter) (LoadError)
    from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-3.2.1/lib/active_support/dependencies.rb:251:in `block in require'"

I did install gem oci8 then activerecord-oracle-enhanced-adapter . Can you help me by having a look? Thanks a lot.

Version information

C:\Lab\railapps\dbtest>gem list ruby-oci8

*** LOCAL GEMS ***

ruby-oci8 (2.1.2 ruby x86-mingw32, 2.0.6)

C:\\Lab\\railapps\\dbtest>gem list activerecord-oracle_enhanced-adapter

*** LOCAL GEMS ***

activerecord-oracle_enhanced-adapter (1.4.1)

database.yml under configure

development:
  adapter: oracle_enhanced
  database: cvrman.cablevision.com
  username: ruby
  password: ruby

My guess is activerecord-oracle_enhanced-adapter and oci8 are not in your Gemfile. Ruby on Rails now uses Bundler by default to manage dependencies.

Try adding the lines:

   gem "activerecord-oracle_enhanced-adapter"
   gem "oci8"

to your Gemfile (located in the root of your project directory) and run bundle install . Then try building your scaffold.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM