1

当我尝试运行时rails generate scaffold test,总是显示以下错误

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'"

我当时确实安装了oci8gem activerecord-oracle-enhanced-adapter。你能帮我看看吗?非常感谢。

版本信息

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

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

1 回答 1

1

我的猜测是activerecord-oracle_enhanced-adapter并且oci8不在您的 Gemfile 中。Ruby on Rails 现在默认使用Bundler来管理依赖项。

尝试添加以下行:

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

到您的 Gemfile(位于项目目录的根目录)并运行bundle install. 然后尝试构建你的脚手架。

于 2012-08-27T21:36:44.170 回答