使用 ruby 2.5,rails 4.2.11,
我正在为一个过去只是直接发送到生产环境的 ruby 项目设置开发环境。
HotWire 包含特定于应用程序的数据,而 QualityDC 包含许多其他应用程序共享的关系信息。我将如何设置它以便我可以添加一个 QualityDC_Dev 实例以供 development.rb 环境使用?
在 database.yml 文件中(在我的 /etc 文件夹中引用 odbc.ini,我有以下内容:
development:
adapter: sqlserver
mode: odbc
dsn: HotWire_Dev
username: webserver
password: password
pool: 5
timeout: 5000
qualitydc:
adapter: sqlserver
mode: odbc
dsn: qualitydc
username: webserver
password: wordpass
pool: 5
timeout: 5000
production:
adapter: sqlserver
mode: odbc
dsn: HotWire
username: webserver
password: password
pool: 5
timeout: 5000
odbc.ini 条目:
[BrazeWire]
Driver = /usr/lib64/libtdsodbc.so.0
Server = server.domain.com
Database = HotWire
tds_version = 8.0
Port = 1433
[BrazeWire_Test]
Driver = /usr/lib64/libtdsodbc.so.0
Server = server.domain.com
Database = HotWire_Dev
tds_version = 8.0
Port = 1433'
[QUALITYDC]
Driver = FreeTDS
Server = server.domain.com
Database = QualityDC
tds_version = 8.0
Port = 1433