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工作?
答
它看起来像你的postgres服务器没有运行。你开始了吗?如果你检查你的系统进程,你会看到postgres守护进程在运行吗?
如果你要使用导轨+ Postgres的,我会建议您检查出this great video by Pete Cooper.
你的PostgreSQL服务器似乎已关闭或听一些其他的端口上。 – vyegorov 2012-04-13 19:43:15