欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Mac搭建Ruby on Rails Postgresql解决方案

程序员文章站 2022-07-15 11:52:28
...
Maccbook OSX10.8.2

注意1 :HomeBrew 安装 Postgresql注意:Postgresql版本就用9.2的,因为Mac自带的用的是9.2的,否则会冲突。

$ brew search postgresql

注意2:
$ rails new duok -d postgresql
$ cat confing/database.yml
$ gem install pg -- --with-pg-config=/usr/local/bin/pg_config
上面这一句很重要,否则会报错:
PG::ConnectionBad
could not connect to server: No such file or directory (PG::Error)
   Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

$ initdb /usr/local/var/postgres

Ubuntu下
http://*.com/questions/2942485/psql-fatal-ident-authentication-failed-for-user-postgres