【问题标题】:Error : Starting POSTGRESQL server错误:启动 POSTGRESQL 服务器
【发布时间】:2013-04-21 19:30:29
【问题描述】:

我对 ruby​​ 和 postgresql 很陌生。
当我尝试运行时

ruby scrpit/server, rake db:migrate, rake db:seed  

我明白了。

Rails 2.3.11 application starting on http:/0.0.0.0:3000  
warning: already initialized constant SESSION_SECRET  
Faraday: you may want to install system_timer for reliable timeouts  
/home/user/.rvm/gems/ruby-1.8.7-p371/gems/activerecord-.3.11/lib/active_record/connection_adapters/postgresql_adapter.rb:941:in `initialize': could not connect to server: Connection refused (PGError)  

Is the server running on host "localhost" (127.0.0.1) and accepting  
TCP/IP connections on port 5432?  

我在 ubuntu 12.04、ruby 1.8.7、rails-2.3、gem 1.5.3

【问题讨论】:

    标签: ruby-on-rails localhost postgresql-9.1


    【解决方案1】:

    这是你应该做的:

    验证 postgres 服务器是否确实在运行

    $ netstat -a | grep postgre
    

    如果它正在运行,请尝试使用psql 命令从终端连接到它。以防它,不运行。尝试手动启动它

    pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
    

    如果还没有启动, server.log 中是否有任何错误消息?如果是,请在此处发布。

    祝你好运!

    【讨论】:

    • 感谢您的回复。我尝试了这两种方法,但都没有奏效。这是错误消息。'pastebin.com/jwVB3NaS
    • -错误:以下软件包具有未满足的依赖关系:postgres-xc:依赖:postgres-xc-client 但不会安装 E:无法纠正问题,您持有损坏的软件包。
    猜你喜欢
    • 2021-08-22
    • 1970-01-01
    • 2019-02-26
    • 2017-06-14
    • 2012-03-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多