Ruby on rails 运行rails服务器时,出现以下错误
运行psql-h localhost时,我得到:Ruby on rails 运行rails服务器时,出现以下错误,ruby-on-rails,macports,Ruby On Rails,Macports,运行psql-h localhost时,我得到: WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.3 => Booting WEBrick => Rails 3.2.3 application starting in development on `http://0.0.0.0:3000` => Call with -d to detach =>
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.3
=> Booting WEBrick
=> Rails 3.2.3 application starting in development on `http://0.0.0.0:3000`
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-3.2.3/lib/active_record/connection_adapters/postgresql_adapter.rb:1194:in `initialize': could not connect to server: Connection refused (PG::Error)
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?
我的系统设置:
MacOSX 10.7.5和所有的东西都是用Macports安装的 看起来您只需要启动postgres如果您在终端中运行
ps aux | grep postgres
,您会得到什么?
psql: could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port 5432?