我最近升级到OSX 10.7,此时我的rails安装在尝试连接到psql服务器时完全被堵塞了.当我从命令行使用时
psql -U postgres
Run Code Online (Sandbox Code Playgroud)
它工作得很好,但是当我尝试使用相同的用户名和密码运行rails服务器或控制台时,我收到此错误
...activerecord-3.0.9/lib/active_record/connection_adapters/postgresql_adapter.rb:950:in `initialize': could not connect to server: Permission denied (PGError)
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
Run Code Online (Sandbox Code Playgroud)
任何可能发生的想法都会非常有用!谢谢!
我几个月前用kyngchaos安装程序安装了postgres.我现在已更新到OSX Lion,但数据库服务器无法启动.
对kyngchaos博客的评论(http://www.kyngchaos.com/blog/2011/20110723_lion)让我看看'postgres'用户:它不再存在了!至少,我不能再"sudo su postgres"了.所以我认为这就是我的服务器无法运行的原因.
如何才能最好地恢复该用户?
我使用自制软件,将此命令写入terminal.app以安装postgresql.
`brew install postgresql`
<pre>==> Installing postgresql dependency: ossp-uuid
==> Downloading ftp://ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
curl: (7) couldn't connect to host
Trying a mirror...
==> Downloading http://www.mirrorservice.org/sites/ftp.ossp.org/pkg/lib/uuid/uuid-1.6.2.tar.gz
######################################################################## 100.0%
==> ./configure --disable-debug --without-perl --without-php --without-pgsql --prefix=/usr/local/Cell
==> make
==> make install
/usr/local/Cellar/ossp-uuid/1.6.2: 12 files, 332K, built in 62 seconds
==> Installing postgresql
==> Downloading http://ftp9.us.postgresql.org/pub/mirrors/postgresql/source/v9.1.1/postgresql-9.1.1.t
######################################################################## 100.0%
==> ./configure --disable-debug --prefix=/usr/local/Cellar/postgresql/9.1.1 --enable-thread-safety --
==> make install-world
==> Caveats
# Build Notes
If builds of PostgreSQL 9 are failing and you have version 8.x …Run Code Online (Sandbox Code Playgroud)