Ruby on Rails:我如何编辑postgresql的database.yml? [英] Ruby on Rails: How can i edit database.yml for postgresql?

查看:944
本文介绍了Ruby on Rails:我如何编辑postgresql的database.yml?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

rails new app =>

rails new app=>

当前的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

源:配置Rails应用程序

这篇关于Ruby on Rails:我如何编辑postgresql的database.yml?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆