运行时遇到问题:
rake db:create:all
我目前有:
$ psql --version
psql (PostgreSQL) 9.3.0
$ which psql
/Applications/Postgres.app/Contents/MacOS/bin/psql
并得到:
$ rake db:create:all
could not connect to server: Permission denied
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `initialize'
/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `new'
/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:1222:in `connect'
/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/Users/stephanecedroni/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
.....
.....
尝试卸载并重新安装pg
gem,但仍然无法正常工作。
首先尝试关注 Ryan Bates 截屏但遇到了一些问题,然后检查了建议设置此路径的 Heroku Postgres:
PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"