我刚刚安装了Sphinx(发行版:archlinux)下载源代码。然后我为Rails安装了“Thinking Sphinx”插件。
我关注official page setup和this 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
但它显示了同样的错误,任何想法?
答案 0 :(得分:7)
您需要在yaml文件bin_path: /usr/bin/sphinx-searchd
答案 1 :(得分:3)
对于任何试图让Sphinx和thinking_sphinx在Windows上工作的人来说,
config/sphinx.yml
应该是这样的:
development:
bin_path: "C:/Sphinx/bin"
答案 2 :(得分:0)
有两件事有助于解决问题。首先,更新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