我在运行PostgreSQL中ActiveRecord gem tests麻烦,我得到以下错误:权限被拒绝运行ActiveRecord的宝石测试PostgreSQL中
rails/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb:1473:in `initialize': could not connect to server: Permission denied (PG::Error)
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
我能够连接到使用psql -h localhost
服务器和创建数据库,等我使用http://postgresapp.com/ postgresql服务器。按照Rails contributing guide的建议运行rake postgresql:build_databases
时出现相同的错误。
铁轨/ ActiveRecord的/测试/ config.yml文件有以下设置(所有我已经改变是用户名):
postgresql:
arunit:
username: pete
min_messages: warning
arunit2:
min_messages: warning
username: pete
难道还有其他设置,我需要在config.yml配置?我试着指定一个主机和空密码,但这根本没有帮助。
我想这是这种情况,这就是为什么我试图指定主机。我认为发生了什么事是'rake postgresql:build_databases'忽略了主机选项,并且我在这之间来回切换并尝试运行测试。仍然无法运行该rake任务,但测试运行良好。谢谢! – 2012-08-05 15:13:04