无法连接到服务器:连接被拒绝(0x0000274D / 10061)

时间:2016-10-06 08:24:21

标签: ruby-on-rails ruby-on-rails-4

我使用rails开发网站但是当我尝试打开本地主机时出现此错误

could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? could not connect to server: Connection refused (0x0000274D/10061)
Is the server running on host "localhost" (127.0.0.1) and accepting TCP/IP connections on port 5432?

如何修复它们

2 个答案:

答案 0 :(得分:1)

在Windows中,搜索“服务”并在列表中搜索postgres。右键单击并选择“开始”。现在尝试

答案 1 :(得分:0)

看起来你的postgreql服务器没有运行。 您可以尝试使用以下命令启动它:

在Linux上:

 sudo service postgresql start

在Windows上:通过postgresql版本运行更改XX:

 net start postgresql-XX

您也可以停止使用postgres并在config / database.yml文件中指定sqlite数据库:

更改此行:

adapter: postgresql

这一行:

adapter: sqlite3
相关问题