【问题标题】:Problem running Thinking Sphinx with Rails 2.3.5使用 Rails 2.3.5 运行 Thinking Sphinx 时出现问题
【发布时间】:2010-04-26 17:50:43
【问题描述】:

我刚刚安装了 Sphinx(发行版:archlinux)下载源代码。然后我为 Rails 安装了“Thinking Sphinx”插件。

我关注了official page setupthis Screencast from Ryan Bates,但是当我尝试索引模型时,它给了我这个错误:

$ rake thinking_sphinx:index
(in /home/benoror/Dropbox/Proyectos/cotizahoy)

Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
  * bin_path
  * searchd_binary_name
  * indexer_binary_name

For more information, read the documentation:
http://freelancing-god.github.com/ts/en/advanced_config.html
Generating Configuration to /home/benoror/Dropbox/Proyectos/cotizahoy/config/development.sphinx.conf
sh: indexer: command not found

我尝试手动启动守护进程 (/usr/bin/sphinx-searchd),更改 config/sphinx.yml 文件:

devlopment:
searchd_binary_name: sphinx-searchd
indexer_binary_name: sphinx-indexer

但它显示相同的错误,有什么想法吗?

【问题讨论】:

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


    【解决方案1】:

    你需要在你的yaml文件中配置bin_path: /usr/bin/sphinx-searchd

    【讨论】:

    • 我有正确的 bin 路径。但仍然显示相同的错误
    【解决方案2】:

    对于任何试图让 Sphinx 和 thinking_sphinx 在 Windows 上工作的人,您的

    config/sphinx.yml
    

    应该是这样的:

    development:
      bin_path: "C:/Sphinx/bin"
    

    【讨论】:

      【解决方案3】:

      有两件事可以帮助解决问题。首先,更新 Thinking Sphinx 插件/gem 版本很有用。我在 ThinkingSphinx 的旧版本(1.3.16)中遇到了这个问题。在更新到 Rails 2 的最新版本 1.4.11 后,警告的数量减少了。您可以使用rake thinking_sphinx:version 确定当前版本。可以使用

      更新插件版本
      curl -L https://github.com/freelancing-god/thinking-sphinx/tarball/v1.4.11 \
        -o thinking-sphinx.tar.gz
      tar -xvf thinking-sphinx.tar.gz -C plugins
      mv plugins/* your_project/vendor/plugins/thinking-sphinx
      

      其次,在配置文件中指定 Thinking Sphinx 插件/gem 的版本通常很有帮助,尤其是在 Sphinx is running on a remote server 和 ThinkingSphinx 插件无法确定本地运行的 Sphinx 版本时。

      production:
        ..
        version: 2.0.4  # Version of Sphinx on remote server 192.168.1.4
        port: 9312  
        address: 192.168.1.4
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-01-07
        • 1970-01-01
        相关资源
        最近更新 更多