rake db:create
または実行しようとしていますrake db:setup
が、次のエラーが発生します。rake db:create
他のRailsプロジェクトで他のフォルダから正常に動作しているので不思議です。
user:project user$ rake db:create
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"?
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord- 3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:991:in `initialize'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord- 3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:991:in `new'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:991:in `connect'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:260:in `initialize'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:27:in `new'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/postgresql_adapter.rb:27:in `postgresql_connection'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord- 3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:304:in `new_connection'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:323:in `checkout_new_connection'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord- 3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block (2 levels) in checkout'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord- 3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in `loop'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:261:in `block in checkout'
/Users/user/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:260:in `checkout'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:162:in `connection'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in `retrieve_connection'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:107:in `retrieve_connection'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:110:in `rescue in create_database'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/railties/databases.rake:54:in `create_database'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/activerecord- 3.1.0/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/user/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/user/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/user/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/user/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "database"=>"project_test", "username"=>nil, "password"=>nil, "min_messages"=>"warning"}
これは私のdatabase.yml
development:
adapter: postgresql
database: project_development
username:
password:
min_messages: warning
test:
adapter: postgresql
database: project_test
username:
password:
min_messages: warning
production:
adapter: postgresql
database: project_production
username:
password:
min_messages: warning
Posgree は にインストールされてい/usr/local/var/postgres
ます。ではなく、同じフォルダで検索しようとするべきではありません/var/pgsql_socket/
か? (とにかく /usr/local/var/pgsql_socket を持っていません)