rails项目使用postgresql数据库启动时报错

问题描述:

rails项目使用postgresql数据库启动时报错_第1张图片


[***@localhost  *****]$ rails s

=> Booting WEBrick

=> Rails 3.2.19 application starting in development on http://0.0.0.0:3000

=> Call with -d to detach

=> Ctrl-C to shutdown server

Exiting

/usr/local/rvm/gems/ruby-2.0.0-p247/gems/activerecord-3.2.19/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize': could not connect to server: Connection refused (PG::ConnectionBad)

Is the server running on host "localhost" (::1) and accepting

TCP/IP connections on port 5432?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 5432?

解决方法:sudo service postgresql start

你可能感兴趣的:(liunx,PostgreSQL,Rails,启动报错)