1

この質問は何百回も聞かれているようですが、今回は違うと思います。

Mac を再起動して rails s を実行すると、サイトは正常に動作します。

➜  BankingApp git:(master) ✗ which psql
/Applications/Postgres.app/Contents/MacOS/bin/psql
➜  BankingApp git:(master) ✗ which postgres
/Applications/Postgres.app/Contents/MacOS/bin/postgres

しかし、サーバーを再起動すると、毎回このエラーが発生します。

私は osx マウンテン ライオンと Postgres.app を使用しています。.zshrc を使用する omyzsh も使用しています。そのファイルには次のものがあります。

PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"
export PGHOST=localhost

Postgres.app も実行しています。

データベース.yml

development:
  adapter: postgresql
  database: BankingApp
  pool: 5
  timeout: 5000

PGAdmin 3 でデータベースを開けば、テーブルなどから選択できるようになり、動作しているようです。このエラーを発生させている不正なプロセスがあるに違いないと思います。

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

Rails.root: /Users/jod/BankingApp

痕跡:

activerecord (4.0.0.rc1) lib/active_record/connection_adapters/postgresql_adapter.rb:796:in `initialize'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/postgresql_adapter.rb:796:in `new'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/postgresql_adapter.rb:796:in `connect'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/postgresql_adapter.rb:513:in `initialize'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `new'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/postgresql_adapter.rb:41:in `postgresql_connection'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/Users/jod/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
activerecord (4.0.0.rc1) lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
4

1 に答える 1

1
development:
  adapter: postgresql
  database: BankingApp
  pool: 5
  timeout: 5000
  host: localhost

これで問題は解決しました!

于 2013-10-26T15:23:47.990 に答える