Ruby on rails PG::错误:无法连接到服务器:连接被拒绝

Ruby on rails PG::错误:无法连接到服务器:连接被拒绝,ruby-on-rails,postgresql,Ruby On Rails,Postgresql,执行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 = 'localh

执行
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
中更改了端口。默认端口是
5432
,正如您在
postgresql.conf
中看到的那样

开发:
适配器:postgresql
编码:utf8
重新连接:false
数据库:开发
游泳池:5
用户名:postgres
密码:密码
主机:本地主机
端口:5454#将其更改为5432

是在配置文件
config/database.yml
中指定的端口5454吗?