Rails和PostgreSQL:角色postgres不存在
我已经在Mac OS Lion上安装了PostgreSQL,并且正在使用Rails应用程序。我使用RVM使所有内容与其他Rails应用程序分开。
I have installed PostgreSQL on my Mac OS Lion, and am working on a rails app. I use RVM to keep everything separate from my other Rails apps.
由于某些原因,当我第一次尝试迁移数据库时,rake无法找到postgres用户。我收到错误消息
For some reason when I try to migrate the db for the first time rake cannot find the postgres user. I get the error
FATAL: role "postgres" does not exist
我有pgAdmin,因此我可以清楚地看到数据库中有一个postgres用户-实际上是admin帐户-因此,我不确定还要做什么。
I have pgAdmin so I can clearly see there is a postgres user in the DB - the admin account in fact - so I'm not sure what else to do.
我读过一些关于PostgreSQL有问题的人,因为它安装在哪条路径上,但是我认为如果它不能解决的话,我不会走那么远
I read somewhere about people having issues with PostgreSQL because of which path it was installed in, but then I don't think I would have gotten that far if it couldn't find the db.
当数据库用户不存在时,将弹出此消息。比较此处的手册。
多个本地数据库 不能作为说明。角色在群集范围内有效。再次手册:
This message pops up, when the database user does not exist. Compare the manual here.
Multiple local databases cannot be the explanation. Roles are valid cluster-wide. The manual again:
请注意,角色是在数据库集群级别定义的,因此
在集群中的所有数据库中均有效。
Note that roles are defined at the database cluster level, and so are valid in all databases in the cluster.
您必须以另一个数据库集群结尾。那将是在同一台计算机上运行的另一台服务器,侦听不同的端口。或者更有可能在另一台机器上。
You must be ending up in another database-cluster. That would be another server running on the same machine, listening to a different port. Or, more likely, on a different machine.
消息是否实际上来自远程服务器?
Could it be that the message comes, in fact, from the remote server?