PG ::错误:无法连接到服务器:连接被拒绝
问题描述:
当你做rake db:migrate:up VERSION="
出现错误PG ::错误:无法连接到服务器:连接被拒绝
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
的端口。默认端口为5432
,你可以在你的postgresql.conf
development:
adapter: postgresql
encoding: utf8
reconnect: false
database: development
pool: 5
username: postgres
password: password
host: localhost
port: 5454 # Change it to 5432
是端口5454的配置文件'配置/ database.yml'规定看? – Ctx