![](/img/trans.png)
[英]PG::ConnectionBad: could not connect to server: Connection refused
[英]PG::Error: could not connect to server: Connection refused
當您rake db:migrate:up VERSION="
,會出現錯誤
PG::Error: 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 5454?
postgresql.conf中
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
port = 5432 # (change requires restart)
其他項目的遷移工作正常
gem 'pg' 0.14.1
postgresql 9.3
如何清除錯誤? 5454
在哪里港口?
如果我更改了postgresql.conf
的端口,可以在其他項目中遷移嗎?
似乎您已更改config/database.yml
的端口。 在postgresql.conf
可以看到默認端口為5432
development:
adapter: postgresql
encoding: utf8
reconnect: false
database: development
pool: 5
username: postgres
password: password
host: localhost
port: 5454 # Change it to 5432
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.