2016-05-18 216 views
1

在试图将我的数据库从我的development.sqlite3文件推送到我的Heroku应用程序时,遇到以下错误消息:pg_dump:[数据库(db)]连接到数据库“开发”失败:无法连接到服务器:连接被拒绝

pg_dump: [archiver (db)] connection to database "development" failed: could not connect to server: Connection refused 
    Is the server running on host "localhost" (::1) and accepting 
    TCP/IP connections on port 5432? 
could not connect to server: Connection refused 
    Is the server running on host "localhost" (127.0.0.1) and accepting 
    TCP/IP connections on port 5432? 
pg_restore: [archiver] input file is too short (read 0, expected 5) 
psql: could not connect to server: Connection refused 
    Is the server running on host "localhost" (::1) and accepting 
    TCP/IP connections on port 5432? 
could not connect to server: Connection refused 
    Is the server running on host "localhost" (127.0.0.1) and accepting 
    TCP/IP connections on port 5432? 
! Heroku client internal error. 
! Search for help at: https://help.heroku.com 
! Or report a bug at: https://github.com/heroku/heroku/issues/new 

我是Heroku新手,无法弄清楚这一点。希望这是简单的,我忽略。

回答

0

首先,sqlite不打算在生产中使用。实际上,Heroku不支持使用sqlite,所以如果你想用Heroku使用你的应用,你需要切换到Postgres:https://devcenter.heroku.com/articles/getting-started-with-rails4#write-your-app

你得到的具体错误是因为你的heroku应用程序连接到端口5432,默认情况下由Postgres使用并且不被sqlite使用。但是,由于您没有PG服务器连接到本地主机,所以您的应用程序因此错误而失败。

相关问题