OSX 10.7 Lion にアップグレードした後の Postgresql の修復で説明されている問題が ありますが、解決されませんでした。
エラーを生成している Postgres アプリケーションは にあります/usr/bin/psql
が、正しいものは にあり
/Library/PostgreSQL/9.1/bin/psql
ます。
.bash_profile
後者を(または で)パスに追加し/etc/paths
、PG gem をアンインストールしてインストールすると、まだエラーが表示されます。
.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.2.1/lib/active_record/connection_adapters/postgresql_adapter.rb:1161:in `initialize': could not connect to server: Permission denied (PG::Error) Is the server running locally and accepting
オプションも使用して、何度か試しました:
-- --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config
何か案が?
編集:
より多くの投稿( http://www.iainlbc.com/2011/10/osx-lion-postgres-could-not-connect-to-database-postgres-after-homebrew-installationなど)を読んだ後、私はただやった続く:
sudo ln -s /private/tmp/.s.PGSQL.5432 /var/pgsql_socket/
そしてそれはうまくいきました。理由はまったくわかりません。Postgres を 2 つインストールしていますか? ファイルの背後にあるアプリはどこにあり/usr/bin/psql
ますか?