【问题标题】:Heroku Database setupHeroku 数据库设置
【发布时间】:2018-09-25 11:26:09
【问题描述】:

我正面临heroku run rake db:create 的以下问题

在RubyonRails技术和Postgresql数据库中的应用。

This is the legacy Heroku CLI. Please install the new CLI from https://cli.heroku.com
Running rake db:create on ⬢ project-name... up, run.2367 (Free)
FATAL:  permission denied for database "postgres"
DETAIL:  User does not have CONNECT privilege.
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"abcdabcd", "username"=>"abcdabcd", "password"=>"abcdabcd", "port"=>5432, "host"=>"ec2-107-21-233-71.compute-1.amazonaws.com"}
rake aborted!
PG::ConnectionBad: FATAL:  permission denied for database "postgres"
DETAIL:  User does not have CONNECT privilege.

你能告诉我我在这个应用程序中缺少什么配置吗?

提前致谢。

【问题讨论】:

    标签: ruby-on-rails postgresql heroku


    【解决方案1】:

    你不能在 heroku 上运行 db:create。相反,您需要提供一个postgresql add-on。 这样做将为您创建一个数据库,并将其凭据作为DATABASE_URL 环境变量提供给您。

    然后您可以运行 db:migrate 来设置所有表格。
    另见https://devcenter.heroku.com/articles/heroku-postgresql

    【讨论】:

      猜你喜欢
      • 2014-02-04
      • 2012-06-19
      • 2019-10-13
      • 2012-12-19
      • 2012-01-26
      • 2012-02-11
      • 2015-10-11
      • 2018-12-21
      • 2016-01-26
      相关资源
      最近更新 更多