Mac搭建Ruby on Rails Postgresql解决方案

阅读更多
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://stackoverflow.com/questions/2942485/psql-fatal-ident-authentication-failed-for-user-postgres

你可能感兴趣的:(Mac搭建Ruby on Rails Postgresql解决方案)