开发者

"Sphinx cannot be found on your system." when running "rake ts:index"

I'm setting up a new machine (OS X 10.6.7) to run a Rails app which uses ThinkingSphinx. I have followed the installation instructions, but I'm still getting the following:

$ rake ts:index
(in /Users/robert/Projects/Office/code/office)
sh: line 1:  7050 Trace/BPT trap          indexer 2>&1
sh: line 1:  7053 Trace/BPT trap          indexer 2>&1

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
sh: line 1:  7055 Trace/BPT trap          indexer 2>&1
Generating Configuration to /Users/robert/Projects/Office/code/office/config/development.sphinx.conf
dyld: Library not loaded: libmysqlclient.18.dylib
  Referenced from: /usr/local/bin/indexer
  Reason: image not found

I read here to run the following:

sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql

But I'm still getting the same error. Not sure if this helps, but some more info:

$ cd /usr/local/mysql/lib
$ ls
lib                        libmysqlclient_r.dylib
libmysqlclient.18.dylib    libmysqld-debug.a
libmysqlclient.a           libmysqld.a
libmysqlclien开发者_如何学JAVAt.dylib       libmysqlservices.a
libmysqlclient_r.18.dylib  mysql
libmysqlclient_r.a         plugin

And from my config/sphinx.yml:

development:
  port: 9312
  enable_star: true
  min_prefix_len: 2
  html_strip: true
  bin_path: /usr/local/bin
production:
  port: 9312
  enable_star: true
  min_prefix_len: 2
  html_strip: true
  bin_path: /usr/local/bin


The sphinx indexing engine consists of a few binaries, for example for indexing, it uses an executable called "indexer". Try to set the values in config/sphinx.yml to the path where you installed sphinx, as suggested in the error message.


The error is thrown when loading the executables. For some reason the dynamic loader can't find the MySQL libraries. I've seen this happen a number of times with recent MySQL releases.

You can change the search path of the MySQL library in the binaries so the loader will load them from a specific location like this:

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/bin/indexer

You will need to do the same for all the other Sphinx binaries (like searchd).


Sometimes these problems occurred if you have installed the sphinx engine before installing the mysql.

In that case, you need to uninstall the sphinx and install it with the following command in macosx.

brew install sphinx --with-mysql

Once you done that, the reference problem will be solved.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜