【发布时间】:2016-02-23 18:11:25
【问题描述】:
我正在尝试设置 SQL Oracle 并使用活动记录来迁移带有 ruby on rails 的 db。 我安装了 sqldeveloper 并创建了一个新连接。这里是第一个错误:
I/O 错误:网络适配器无法建立连接
然后我安装了instantclient basic、sdk、sqlplus和两个gem:
gem 'ruby-oci8'
gem 'activerecord-oracle_enhanced-adapter'
但我收到了这个错误:
LoadError:无法加载“active_record/connection_adapters/oracle_adapter”。确保 config/database.yml 中的适配器有效。如果您使用“mysql”、“mysql2”、“postgresql”或“sqlite3”以外的适配器,请将必要的适配器 gem 添加到 Gemfile。
这是我的 database.yml:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
development:
adapter: oracle
database: development
username: nick
password:
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: oracle
database: test
username: nick
password:
production:
adapter: oracle
database: production
username: nick
password:
我无法找到解决方案,我该怎么办?
【问题讨论】:
标签: sql ruby oracle ruby-on-rails-4 ubuntu