Postgres - 无法在尝试rake db:create:all后连接到服务器 [英] Postgres - could not connect to server after trying rake db:create:all

查看:189
本文介绍了Postgres - 无法在尝试rake db:create:all后连接到服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让Postgres在OS X Lion - homebrew - rvm上运行。



http://railscasts.com/episodes/342-migrating-to-postgresql



按照上述说明进行操作后,遇到了此处所述的相同问题:



在升级到OSX 10.7 Lion后修复Postgresql



运行其中psql yieled usr / bin / psql 何时应该 usr / local / bin / psql



好的,所以我修改了这样的路径(这是所有的文件):

  export PATH =/ usr / local / bin:$ PATH
[[-s/Users/chase/.rvm/scripts/rvm]] &&& source/Users/chase/.rvm/scripts/rvm

良好 - source〜/ .bash_profile 然后其中psql 现在产生 usr / local / bin / psql

postgresql
作为数据库,它工作,直到我尝试 rake db:create:all ,这导致

 无法连接到服务器:没有这样的文件或目录
服务器在本地运行,并在Unix域套接字/ tmp /上接受
连接。 s.PGSQL.5432?

任何线索?



UPDATE



我最后安装了Postgres.app: http ://postgresapp.com/ - this works。

解决方案

http://postgresapp.com 将自己定义为在Mac上开始使用PostgreSQL的最简单的方法,只需下载,拖动到应用程序文件夹,然后双击 。它为我工作完美。


I'm trying to get Postgres up and running on OS X Lion - homebrew - rvm.

http://railscasts.com/episodes/342-migrating-to-postgresql

After following the above instructions, I ran into the same problem described here:

Repairing Postgresql after upgrading to OSX 10.7 Lion

Running which psql yieled usr/bin/psql when it should be usr/local/bin/psql

Ok, so I modified the path like this (this is all that is in the file):

export PATH="/usr/local/bin:$PATH"
[[ -s "/Users/chase/.rvm/scripts/rvm" ]] && source "/Users/chase/.rvm/scripts/rvm"

Good - running source ~/.bash_profile then which psql now yields usr/local/bin/psql

However, when I go generate a new rails app with -d postgresql as the database, it works up until I try rake db:create:all which results in

could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Any clue?

UPDATE

I ended up installing the Postgres.app: http://postgresapp.com/ - this works.

解决方案

http://postgresapp.com defines itself as "The easiest way to get started with PostgreSQL on the Mac. Just download, drag to the applications folder, and double-click". It worked perfectly for me.

这篇关于Postgres - 无法在尝试rake db:create:all后连接到服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆