运行思考Sphinx与Rails 2.3.5的问题

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

我按照官方页面设置和Ryan Bates的这个Screencast ,但是当我尝试索引模型时,它给了我这个错误:

$ 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 

但它显示了同样的错误,任何想法?

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

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

 config/sphinx.yml 

应该看起来像这样:

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

有两件事有助于解决问题。 首先,更新Thinking Sphinx插件/ gem版本很有用。 我在ThinkingSphinx的旧版本(1.3.16)中遇到了这个问题。 更新到Rails 2,1.4.11的最新版本后,警告的数量更少。 您可以使用rake thinking_sphinx:version确定当前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在远程服务器上运行并且ThinkingSphinx插件无法确定哪个Sphinx版本在本地运行。

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