Mac OS X Lion 上的 Ruby 1.9.3
关注了关于这个主题的几篇关于 SO 的帖子。都没有帮助。
尝试在这里运行我的第一个rails 和 postgreSQL 应用程序。
在此之后:http: //guides.rubyonrails.org/getting_started.html
当我做:
"rake db:create"
我得到:
无法连接到服务器:没有这样的文件或目录服务器是否在本地运行并接受 Unix 域套接字“/tmp/.s.PGSQL.5432”上的连接?
一些事实:
不确定 /tmp/ 指的是什么,但如果它是来自根目录的,那么:
1) 权限:
drwxrwxrwx 11 根轮 374B Jan 4 17:33 tmp
2) 另外,我看不到文件 .s.PGSQL.5432。
3)我试图通过将以下内容添加到 database.yml 来强制套接字位置:
development:
adapter: postgresql
encoding: unicode
database: testblog_development
pool: 5
username: blog
password:
socket: /var/pgsql_socket # <-- this line
(它仍然显示与 /tmp/ 路径相同的错误)。
4)当我这样做时,which postgres
我得到:
/usr/local/bin/postgres
(I've used homebrew installation)
5)当我这样做时:brew info postgres
我得到:
postgresql:稳定 9.2.2 http://www.postgresql.org/取决于:readline、ossp-uuid 与:postgres-xc /usr/local/Cellar/postgresql/9.2.2 冲突(2819 个文件,39M)* https ://github.com/mxcl/homebrew/commits/master/Library/Formula/postgresql.rb
和其他一堆信息。