【发布时间】:2017-03-30 13:07:12
【问题描述】:
我的应用程序的本地版本运行良好,但我正在尝试将数据推送到我的实时应用程序。我正在运行 rails db:migrate RAILS_ENV=production 并收到 PG::ConnectionBad: FATAL: role "***" does not exist 消息。
我将 .yml 文件中的“用户名”“数据库”和“密码”作为我的 heroku postgres 插件的数据库凭据下给出的详细信息
我的 .yml 文件:
default: &default
adapter: postgresql
pool: 5
timeout: 5000
development:
adapter: postgresql
database: postgresql-rectangular-42683
pool: 5
timeout: 5000
test:
adapter: postgresql
database: postgresql-rectangular-42683
pool: 5
timeout: 5000
production:
adapter: postgresql
encoding: utf8
database: ***
pool: 5
username: ***
password: *********
#host: ***.***.***.*** #-> only for third party db server
【问题讨论】:
-
你必须先创建角色或使用现有角色
username: postgres -
如果您使用的用户名不同于
postgres -
如果我使用用户名:postgres 并且只使用给定的数据库名称“postgresql-rectangular-42683”,那么终端不会抛出任何反馈并检查 heroku,数据库没有更新。我如何确定这是在更新我的产品数据库?特别是当我运行 ENV=production 时?
-
Heroku 不使用你的 database.yml
-
@DeepakMahakale 你完全确定吗?
标签: ruby-on-rails postgresql heroku