【问题标题】:ThinkinSphinx - not found - Sphinx cannot be found on your systemThinkinSphinx - 未找到 - 在您的系统上找不到 Sphinx
【发布时间】:2013-05-17 15:05:44
【问题描述】:

我尝试在我的新服务器上安装带有 rails 3.0.1 的 sphinx。

我总是这样:

在您的系统上找不到 Sphinx。您可能需要配置 config/sphinx.yml 文件中的以下设置:* bin_path * searchd_binary_name * indexer_binary_name

有关更多信息,请阅读文档: http://freelancing-god.github.com/ts/en/advanced_config.html

一些谜语错误。

首先我尝试通过 ubuntu 包:

sudo apt-get install sphinxsearch

这没有帮助,所以我尝试从网站加载它并自己编译它。

我可以执行:

RAILS_ENV=生产 rake ts:rebild

我找到了:

whereis searchd searchd: /usr/local/bin/searchd

但是 crontab -e 无法执行重建方法...

这个错误也来自购买尝试手动开始搜索:

searchd --pidfile --config /var/www/config/production.sphinx.conf 狮身人面像 2.1.1-beta (rel21-r3701) 版权所有 (c) 2001-2013,Andrew Aksyonoff 版权所有 (c) 2008-2013,Sphinx Technologies Inc (http://sphinxsearch.com)

使用配置文件'/var/www/config/production.sphinx.conf'... 警告:/var/www/config/production.sphinx.conf 第 8 行中已弃用密钥“地址”;改用“听”。 警告:/var/www/config/production.sphinx.conf 第 9 行中已弃用密钥“端口”;改用“听”。 致命:无法锁定 pid 文件“/var/www/log/searchd.production.pid”:资源暂时不可用(搜索已在运行?)

谢谢!!!祝你周末愉快!

【问题讨论】:

    标签: ruby-on-rails thinking-sphinx


    【解决方案1】:

    ThinkinSphinx 在 /usr/bin/ 上查找搜索和索引器,因此我创建了一个指向 /usr/local/bin/searchd 和 /usr/local/bin/indexer 的符号链接并开始工作。

    sudo ln -s /usr/local/bin/searchd  /usr/bin/searchd
    sudo ln -s /usr/local/bin/indexer  /usr/bin/indexer
    

    问候

    【讨论】:

      【解决方案2】:

      需要注意的几点:

      首先,如果您使用的是 Thinking Sphinx 2.x,您应该将 Sphinx 降级到早期版本(它不适用于 Sphinx 2.1.1-beta。2.0.6 应该没问题)。

      如果完成后您仍然遇到问题,那么 Sphinx 二进制文件可能不在您的 PATH 中。您可能希望将它们的位置(因此,如果 movihus 正确,则为 /usr/local/bin)添加到您的 shell 环境中的 PATH 中,但也将其添加到 Cron 的路径中(因为它是一个单独的上下文)。在你的 crontab 中这样的行应该可以解决问题:

      PATH: /usr/local/bin:/usr/bin:/bin
      

      另外:您不需要定期重建,只需重新索引 - 仅当您的 Sphinx 索引定义更改时才需要重建。

      rake ts:index
      

      【讨论】:

        【解决方案3】:

        感谢您的回答:

        我做了两个:符号链接和下载并安装版本 2.0.6-release。

        然后我这样做了:

        RAILS_ENV=production rake _0.8.7_ thinking_sphinx:configure
        

        它返回了:

        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 /var/www/config/production.sphinx.conf
        Generating Configuration to /var/www/config/production.sphinx.conf
        

        不,我得到了这些行:

        RAILS_ENV=production rake _0.8.7_ thinking_sphinx:index
        

        (在 /var/www 中)

        在您的系统上找不到 Sphinx。您可能需要配置 config/sphinx.yml 文件中的以下设置:* bin_path * searchd_binary_name * indexer_binary_name

        有关更多信息,请阅读文档: http://freelancing-god.github.com/ts/en/advanced_config.html 生成配置到 /var/www/config/production.sphinx.conf Sphinx 2.0.6-release (r3473) 版权所有 (c) 2001-2012, Andrew Aksyonoff 版权所有 (c) 2008-2012,Sphinx Technologies Inc (http://sphinxsearch.com)

        使用配置文件 '/var/www/config/production.sphinx.conf'... 警告: /var/www/config/production.sphinx.conf 中不推荐使用密钥“地址” 第 8 行;改用“听”。

        但这并不能解决我的问题...

        当我尝试打开 rails 控制台时:

        RAILS_ENV=production rails c
        
        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
        Loading production environment (Rails 3.0.1)
        1.9.2-p320 :001 > Vacancy.search "ruby"
        
        Riddle cannot detect Sphinx on your machine, and so can't determine which
        version of Sphinx you are planning on using. Please use one of the following
        lines after "require 'riddle'" to avoid this warning.
        
          require 'riddle/0.9.8'
          # or
          require 'riddle/0.9.9'
          # or
          require 'riddle/1.10'
        
        
        
        Riddle cannot detect Sphinx on your machine, and so can't determine which
        version of Sphinx you are planning on using. Please use one of the following
        lines after "require 'riddle'" to avoid this warning.
        
          require 'riddle/0.9.8'
          # or
          require 'riddle/0.9.9'
          # or
          require 'riddle/1.10'
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2014-05-12
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2021-11-12
          • 1970-01-01
          相关资源
          最近更新 更多