在Mac上安装Sphinx的问题

时间:2011-06-06 07:59:27

标签: ruby-on-rails ruby-on-rails-3 sphinx mysql2

使用以下方法编译代码: -

LDFLAGS="-arch x86_64" ./configure --prefix=/usr/local --with-mysql=/usr/local/mysql-5.5.9-osx10.6-x86_64

编译的O / p。

    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating src/Makefile
    config.status: creating libstemmer_c/Makefile
    config.status: creating sphinx.conf.dist
    config.status: creating sphinx-min.conf.dist
    config.status: creating config/config.h
    config.status: executing depfiles commands

    configuration done
    ------------------

    You can now run 'make' to build Sphinx binaries,
    and then run 'make install' to install them.

制造的O / p: -

    g++ -DHAVE_CONFIG_H -I. -I../config  -DSYSCONFDIR="\"/usr/local/etc\"" -I/usr/local/include -I/usr/local/mysql-5.5.9-osx10.6-x86_64/include  -Os -g -fno-common -fno-strict-aliasing -arch x86_64   -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG -MT tests.o -MD -MP -MF .deps/tests.Tpo -c -o tests.o tests.cpp
    mv -f .deps/tests.Tpo .deps/tests.Po
    g++  -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG  -arch x86_64 -o tests tests.o libsphinx.a  -L/usr/local/mysql-5.5.9-osx10.6-x86_64/lib -lmysqlclient   -lpthread  -lodbc -lz -lexpat  -L/usr/local/lib  -lpthread
    Making all in test
    make[1]: Nothing to be done for `all'.
    make[1]: Nothing to be done for `all-am'.

make install的O / p: -

    Making install in src
    if test -d ../.svn; then svn info .. --xml | perl svnxrev.pl; fi;
    make  install-am
    test -z "/usr/local/bin" || ../config/install-sh -c -d "/usr/local/bin"
      /usr/bin/install -c 'indexer' '/usr/local/bin/indexer'
      /usr/bin/install -c 'searchd' '/usr/local/bin/searchd'
      /usr/bin/install -c 'search' '/usr/local/bin/search'
      /usr/bin/install -c 'spelldump' '/usr/local/bin/spelldump'
      /usr/bin/install -c 'indextool' '/usr/local/bin/indextool'
    make[3]: Nothing to be done for `install-data-am'.
    Making install in test
    make[1]: Nothing to be done for `install'.
    test -z "/usr/local/etc" || config/install-sh -c -d "/usr/local/etc"
     /usr/bin/install -c -m 644 'sphinx.conf.dist' '/usr/local/etc/sphinx.conf.dist'
     /usr/bin/install -c -m 644 'sphinx-min.conf.dist' '/usr/local/etc/sphinx-min.conf.dist'
     /usr/bin/install -c -m 644 'example.sql' '/usr/local/etc/example.sql'
    make  install-data-hook
    mkdir -p /usr/local/var/data && mkdir -p /usr/local/var/log

如果我尝试运行思考sphinx服务器: -

    rake thinking_sphinx:index
    (in /Users/mohit/projects/urbanAdda)
    sh: line 1: 26356 Trace/BPT trap          indexer 2>&1
    sh: line 1: 26359 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: 26361 Trace/BPT trap          indexer 2>&1
    Generating Configuration to /Users/mohit/projects/urbanAdda/config/development.sphinx.conf
    dyld: Library not loaded: libmysqlclient.16.dylib
      Referenced from: /usr/local/bin/indexer
      Reason: image not found

2 个答案:

答案 0 :(得分:3)

sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql-5.5.9-osx10.6-x86_64//lib/libmysqlclient.16.dylib /usr/local/bin/indexer

sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql-5.5.9-osx10.6-x86_64//lib/libmysqlclient.16.dylib /usr/local/bin/searchd

解决了我的问题

答案 1 :(得分:1)

动态链接器找不到mysqlclient库。 尝试将其安装的路径添加到DYLD_LIBRARY_PATH环境变量中。 当/如果您打算重建它,请将“-Wl,-rpath / path / to / lib”添加到LDFLAGS。