gpt4 book ai didi

ruby-on-rails - 用于 postgresql 的 Ruby on Rails : How can I edit database. yml?

转载 作者:数据小太阳 更新时间:2023-10-29 06:22:04 24 4
gpt4 key购买 nike

Rails 新应用。

当前的database.yml是这样的:

# 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 数据库编辑它。

我该怎么做?

最佳答案

简单地:

development:
adapter: postgresql
encoding: unicode
database: blog_development
pool: 5
username: blog
password:
host: localhost

来源:Configuring Rails Applications

关于ruby-on-rails - 用于 postgresql 的 Ruby on Rails : How can I edit database. yml?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7689097/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com