Ruby on rails 铁轨中的斯芬克斯-错误:索引';用户核心';:sql“连接:致命:角色”;根“;不存在

Ruby on rails 铁轨中的斯芬克斯-错误:索引';用户核心';:sql“连接:致命:角色”;根“;不存在,ruby-on-rails,postgresql,sphinx,thinking-sphinx,Ruby On Rails,Postgresql,Sphinx,Thinking Sphinx,当我运行rake ts:index时,我得到以下错误: Generating Configuration to /Users/main/rails_projects/glassboard/config/development.sphinx.conf Sphinx 2.0.4-release (r3135) Copyright (c) 2001-2012, Andrew Aksyonoff Copyright (c) 2008-2012, Sphinx Technologies Inc (http

当我运行rake ts:index时,我得到以下错误:

Generating Configuration to /Users/main/rails_projects/glassboard/config/development.sphinx.conf
Sphinx 2.0.4-release (r3135)
Copyright (c) 2001-2012, Andrew Aksyonoff
Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/Users/main/rails_projects/glassboard/config/development.sphinx.conf'...
indexing index 'user_core'...
ERROR: index 'user_core': sql_connect: FATAL:  role "root" does not exist
 (DSN=pgsql://root:***@localhost:5432/glassboard_development).
total 0 docs, 0 bytes
total 0.005 sec, 0 bytes/sec, 0.00 docs/sec
skipping non-plain index 'user'...
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
我在网上找不到关于这个错误的任何信息,斯芬克斯对我的数据库有什么问题


我的操作系统是Mac 10.6.8,我正在使用(PostgreSQL)9.1.4。

您使用的是什么版本的Thinking Sphinx?很久以前有一个bug,假设默认数据库用户是root,如果没有指定它(适用于MySQL,但不适用于PostgreSQL),但是这个bug已经修复了。我建议对您正在使用的任何Rails(Rails 2:TS 1.4.14、Rails 3:TS 2.0.14)更新到最新的适当版本


或者,如果您使用的是Rails 3.1或更高版本,您也可以更新到TS 3.0.2,但是有重大的变化:

它正在尝试以用户
根用户的身份进行连接,但是没有。以数据库的用户身份连接。知道我该怎么做吗?我正在尝试-中的说明,但我得到错误:创建角色的权限被拒绝,即使我使用了管理员帐户。您必须作为PostgreSQL超级用户或具有创建用户的
CREATEROLE
权限的用户连接。你认为是管理员的帐户不是。在典型的安装中,您会使用
postgres
帐户,但您没有告诉我们有关您的操作系统、Pg安装、Pg版本等的任何信息。我的操作系统是Mac 10.6.8,我正在使用(PostgreSQL)9.1.4。您还需要什么其他信息?我没有创建postgres帐户,你是说我需要在Mac上创建一个名为postgres的新用户?有没有办法让我的标准登录帐户成为Postgres超级用户?我与超级用户重新打交道的问题在这里得到了解决: