使用 Rails 2.3.5 运行 Thinking Sphinx 时出现问题

发布于 2024-08-30 11:46:51 字数 1054 浏览 9 评论 0原文

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

我遵循了官方页面设置来自 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

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

I just installed Sphinx (distro: archlinux) downloading the source. Then I installed "Thinking Sphinx" plugin for Rails.

I followed the official page setup and this Screencast from Ryan Bates, but when I try to index the models it gives me this error:

$ 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

I tried starting the daemon manually (/usr/bin/sphinx-searchd), changing the config/sphinx.yml file:

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

But it shows the same error, any ideas ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

去了角落 2024-09-06 11:46:51

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

you need to configure in your yaml file bin_path: /usr/bin/sphinx-searchd

如若梦似彩虹 2024-09-06 11:46:51

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

config/sphinx.yml

应该看起来像这样:

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

For anybody trying to get Sphinx and thinking_sphinx working on windows, your

config/sphinx.yml

should look something like this:

development:
  bin_path: "C:/Sphinx/bin"
那伤。 2024-09-06 11:46:51

有两件事有助于解决问题。首先,更新 Thinking Sphinx 插件/gem 版本很有用。我在使用旧版本(1.3.16)的 ThinkingSphinx 时遇到了这个问题。 Rails 2 更新到最新版本 1.4.11 后,警告数量减少了。您可以使用rakethinking_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

There are two things that help solving the problem. First, it is useful to update the Thinking Sphinx plugin/gem version. I had this problem with an older version (1.3.16) of ThinkingSphinx. After an update to the latest version for Rails 2, 1.4.11, the number of warnings was smaller. You can determine the current version with rake thinking_sphinx:version. It is possible to update the plugin version with

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

Second, it is often helpful to specify the version of the Thinking Sphinx plugin/gem in the configuration file, especially if Sphinx is running on a remote server and the ThinkingSphinx plugin can not determine which Sphinx version is running locally.

production:
  ..
  version: 2.0.4  # Version of Sphinx on remote server 192.168.1.4
  port: 9312  
  address: 192.168.1.4
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文