簡體   English   中英

PG ::錯誤:無法連接到服務器:連接被拒絕

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM