首页 > 技术文章 > rails指定pg为开发数据库

dccmmtop 2017-08-15 16:16 原文

首先安装一个gem gem 'pg'
然后在database.yml中如下

default: &default
  adapter: postgresql
  pool: 64
  timeout: 5000
  encoding: utf-8

#
# PRODUCTION
#
production:
  <<: *default
  database: dc-form

#
# Development specific
#
development:
  <<: *default
  database: dc-forum

# 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:
  <<: *default
  database: dcforum-test

推荐阅读