Ruby on Rails:如何为 postgresql 编辑 database.yml? [英] Ruby on Rails: How can I edit database.yml for postgresql?
本文介绍了Ruby on Rails:如何为 postgresql 编辑 database.yml?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Rails 新应用.
当前的database.yml是这样的:
The current database.yml is like that:
# 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
我需要为 postgresql 数据库编辑这个.
I need to edit this for postgresql database.
我该怎么做?
推荐答案
简单:
development:
adapter: postgresql
encoding: unicode
database: blog_development
pool: 5
username: blog
password:
host: localhost
这篇关于Ruby on Rails:如何为 postgresql 编辑 database.yml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文