Rails应用程序使用PostgreSQL显示PG ::错误

Rails应用程序使用PostgreSQL显示PG ::错误

问题描述:

我刚开始使用Rails应用程序使用PostgreSQL显示PG ::错误

rails new myapp --database=postgresql 

然后我产生一些静态页面一个新的Rails应用程序:

rails g controller StaticPages home about 

当我开始在服务器和本地主机访问: 3000/static_pages /家,PG ::错误显示出来:

PG::Error 

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? 

我没有改变任何东西

任何想法如何使postgresql工作?

+0

你的PostgreSQL服务器似乎已关闭或听一些其他的端口上。 – vyegorov 2012-04-13 19:43:15

它看起来像你的postgres服务器没有运行。你开始了吗?如果你检查你的系统进程,你会看到postgres守护进程在运行吗?

如果你要使用导轨+ Postgres的,我会建议您检查出this great video by Pete Cooper.

+0

是的,我没有看到它运行。任何想法如何启动它?感谢视频顺便说一句,很棒的资源。但是我现在在使用windows – alexZ 2012-04-12 22:42:29

+0

如何启动它取决于你如何安装它,但是你可以从查找Windows服务器开始。 – kgrittn 2012-04-13 12:24:06