dumP
dumP

Reputation: 801

ThinkinSphinx - not found - Sphinx cannot be found on your system

i tried to install sphinx with rails 3.0.1 on my new server.

I always get this:

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

or

some riddle error.

First i tried via ubuntu packages:

sudo apt-get install sphinxsearch

This doesn´t helped, so i tried to load it from the website and compiled it for myself.

I can exec:

RAILS_ENV=production rake ts:rebild

And i found it:

whereis searchd searchd: /usr/local/bin/searchd

But crontab -e could not exec the rebuild method...

Also this error comes buy try to start searchd manualy:

searchd --pidfile --config /var/www/config/production.sphinx.conf Sphinx 2.1.1-beta (rel21-r3701) Copyright (c) 2001-2013, Andrew Aksyonoff Copyright (c) 2008-2013, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/var/www/config/production.sphinx.conf'... WARNING: key 'address' is deprecated in /var/www/config/production.sphinx.conf line 8; use 'listen' instead. WARNING: key 'port' is deprecated in /var/www/config/production.sphinx.conf line 9; use 'listen' instead. FATAL: failed to lock pid file '/var/www/log/searchd.production.pid': Resource temporarily unavailable (searchd already running?)

Thank you!!! and have a nice weekend!

Upvotes: 2

Views: 4180

Answers (3)

dumP
dumP

Reputation: 801

Thank you for your answers:

i did both: symbolic links and download and install the version 2.0.6-release.

then i did this:

RAILS_ENV=production rake _0.8.7_ thinking_sphinx:configure

it returned:

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 /var/www/config/production.sphinx.conf
Generating Configuration to /var/www/config/production.sphinx.conf

and no i get these lines:

RAILS_ENV=production rake _0.8.7_ thinking_sphinx:index

(in /var/www)

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 /var/www/config/production.sphinx.conf Sphinx 2.0.6-release (r3473) Copyright (c) 2001-2012, Andrew Aksyonoff Copyright (c) 2008-2012, Sphinx Technologies Inc (http://sphinxsearch.com)

using config file '/var/www/config/production.sphinx.conf'... WARNING: key 'address' is deprecated in /var/www/config/production.sphinx.conf line 8; use 'listen' instead.

But it doesn´t fix my problem...

And when i tried to open rails console:

RAILS_ENV=production rails c

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
Loading production environment (Rails 3.0.1)
1.9.2-p320 :001 > Vacancy.search "ruby"

Riddle cannot detect Sphinx on your machine, and so can't determine which
version of Sphinx you are planning on using. Please use one of the following
lines after "require 'riddle'" to avoid this warning.

  require 'riddle/0.9.8'
  # or
  require 'riddle/0.9.9'
  # or
  require 'riddle/1.10'



Riddle cannot detect Sphinx on your machine, and so can't determine which
version of Sphinx you are planning on using. Please use one of the following
lines after "require 'riddle'" to avoid this warning.

  require 'riddle/0.9.8'
  # or
  require 'riddle/0.9.9'
  # or
  require 'riddle/1.10'

Upvotes: 1

pat
pat

Reputation: 16226

A few things to note:

Firstly, if you're using Thinking Sphinx 2.x, you should downgrade Sphinx to an earlier version (it won't work with Sphinx 2.1.1-beta. 2.0.6 should be fine).

If that's done and you're still having problems, then the Sphinx binaries might not be in your PATH. You'll probably want to add their location (so, if movihus is correct, /usr/local/bin) to your PATH in your shell environment, but also add it to Cron's path as well (as it is a separate context). Something like this line in your crontab should do the trick:

PATH: /usr/local/bin:/usr/bin:/bin

Also: you shouldn't need to rebuild regularly, just reindex - rebuilds are only required when your Sphinx index definitions change.

rake ts:index

Upvotes: 2

movihus
movihus

Reputation: 141

ThinkinSphinx lookup searchd and indexer at /usr/bin/ so I created a symbolic link to /usr/local/bin/searchd and /usr/local/bin/indexer and worked.

sudo ln -s /usr/local/bin/searchd  /usr/bin/searchd
sudo ln -s /usr/local/bin/indexer  /usr/bin/indexer

Greetings

Upvotes: 2

Related Questions