在我的config/database.yml文件可以在rails應用上使用兩個sqlite3數據庫嗎?
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# 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: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
otherdb:
adapter: sqlite3
database: /c/Users/dsun/Documents/apeers/db/development.sqlite3
pool: 5
timeout: 10000
,並在我的模型,我通過調用新的數據庫:establish_connection :otherdb
但這返回一個錯誤,database configuration does not specify adapter
所以是問題那sqlite3不能在一次使用2分貝?
如果是這樣,我該如何解決這個問題。
看一看這個問題: http://stackoverflow.com/questions/10360705/how-to-use-multiple-databases-in-a-rails-app-using-the-database- yml – ply 2013-04-04 19:40:23
你試圖尋找解決方案的根本原因是什麼? – 2013-04-04 21:09:03