【问题标题】:Sphinx in Rails - ERROR: index 'user_core': sql_connect: FATAL: role "root" does not existRails 中的 Sphinx - 错误:索引“user_core”:sql_connect:致命:角色“root”不存在
【发布时间】:2013-03-24 18:41:01
【问题描述】:

当我运行 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

网上找不到关于这个错误的信息,Sphinx 我的数据库有什么问题?

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

【问题讨论】:

  • 它正在尝试以用户root 的身份进行连接,但没有。以您的数据库存在的用户身份连接。
  • 知道我该怎么做吗?我正在尝试来自 - articles.slicehost.com/2009/5/7/… 的说明,但我收到 ERROR: permission denied to create role 即使我 su 进入管理员帐户
  • 您必须以 PostgreSQL 超级用户或具有CREATEROLE 权限的用户身份连接才能创建用户。您认为是管理员的帐户不是。在典型安装中,您会使用 postgres 帐户,但您没有告诉我们有关您的操作系统、Pg 安装、Pg 版本等的任何信息。
  • 我的操作系统是 Mac 10.6.8,我使用的是 (PostgreSQL) 9.1.4。您还需要什么其他信息?我没有创建 postgres 帐户,你是说我需要在我的 Mac 上创建一个名为 postgres 的新用户?有什么方法可以让我的标准登录帐户成为 Postgres 超级用户?
  • 我与超级用户打交道的问题在这里得到了解决:stackoverflow.com/questions/15791406/…

标签: ruby-on-rails postgresql sphinx thinking-sphinx


【解决方案1】:

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

或者,如果您使用的是 Rails 3.1 或更高版本,您可以更新到 TS 3.0.2 - 但那里有重大变化:http://pat.github.com/thinking-sphinx/upgrading.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-02-18
    • 2015-08-19
    • 2018-12-02
    • 1970-01-01
    • 2017-12-20
    • 2015-04-01
    • 2012-08-08
    • 1970-01-01
    相关资源
    最近更新 更多