2016-05-18 263 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服務器連接到本地主機,所以您的應用程序因此錯誤而失敗。

相關問題