首次设置Heroku数据库

Lui*_*igi 1 database postgresql ruby-on-rails heroku

我正在使用postgresql并在我的本地开发环境下运行.我将我的应用程序部署到Heroku,现在我需要设置heroku来使用数据库就像我在本地一样.

在本地,我会运行这个:

rake db:create
rake db:migrate
Run Code Online (Sandbox Code Playgroud)

在heroku上,我尝试了同样的事情:

heroku run rake db:create
Run Code Online (Sandbox Code Playgroud)

但是,这会返回此错误:

FATAL:  permission denied for database "postgres"
DETAIL:  User does not have CONNECT privilege.

Couldn't create database for {"adapter"=>"postgresql", "username"=>"stegjyxfak", "password"=>"wB-Yfh450945jI5UrnFjxdwZ_o4N5", "port"=>5432, "database"=>"d64phj348vgdg5hm", "host"=>"ec2-107-20-191-205.compute-1.amazonaws.com"}
Run Code Online (Sandbox Code Playgroud)

我应该运行什么来设置我的heroku数据库?我使用的是Rails 4.0,如果它是相对的.