Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setting up Thinking-Sphinx on Mac OS X using Homebrew

Out of the box, Homebrew does a default installation on Sphinx:

$ brew install sphinx

However, if you're using MySQL, the thinking-sphinx gem won't work because it needs to use MySQL libraries.

If you managed to screw up the first time, uninstall sphinx first:

$ brew remove sphinx

and do an interactive reinstallation:

$ brew install --interactive sphinx

This will take you to the installation folder, so you can do additional commands yourself. Add MySQL dependencies by doing:

$ ./configure --with-mysql

$ make

$ make install

@NewAlexandria

This comment has been minimized.

Copy link

NewAlexandria commented Dec 27, 2012

Instead, you can brew install sphinx --mysql

Find the options for any formula with brew options <formula_name>

@Sjors

This comment has been minimized.

Copy link

Sjors commented Dec 31, 2012

@NewAlexandria when I do that, it tells me:
"Sphinx depends on either MySQL or PostreSQL as a datasource"

I also tried adding the path to my mysql installation (also installed through homebrew):
brew install sphinx --mysql=/usr/local/bin

@Sjors

This comment has been minimized.

Copy link

Sjors commented Dec 31, 2012

When I try --interactive method, I end up with a message saying "Error: Empty installation". In this case I used --mysql=/user/local in stead of /user/local/bin, to avoid an error message.

@johny

This comment has been minimized.

Copy link

johny commented Jan 7, 2013

Even though my installation ended with the same error message, sphinx is working for me. Try running searchd

@flsafe

This comment has been minimized.

Copy link

flsafe commented Jan 20, 2013

I also received the message "Sphinx depends on either MySQL or PostreSQL as a datasource". Despite the error indexing with MySQL worked just fine.

@tresloukadu

This comment has been minimized.

Copy link

tresloukadu commented Oct 10, 2013

I installed MySQL fistly and after Sphinx I had no problems. MySQL was installed through brew also.

@bluesand

This comment has been minimized.

Copy link

bluesand commented Mar 2, 2014

when i installed with --mysql, there is a waring Warning: Could not fix libmysqlclient.18.dylib in /usr/local/Cellar/sphinx/2.1.4/bin/wordbreaker.Am I wrong ? I installed MySQL with dmg firstly,thx.

@hishammalik

This comment has been minimized.

Copy link

hishammalik commented May 23, 2014

brew install sphinx --mysql worked fine for me

@VVCepheiA

This comment has been minimized.

Copy link

VVCepheiA commented Nov 13, 2014

brew install sphinx --mysql
==> Downloading http://sphinxsearch.com/files/sphinx-2.2.5-release.tar.gz
Already downloaded: /Library/Caches/Homebrew/sphinx-2.2.5.tar.gz
==> Downloading http://snowball.tartarus.org/dist/libstemmer_c.tgz

################################################################## 100.0%

Error: SHA1 mismatch
Expected: 9b0f120a68a3c688b2f5a8d0f681620465c29d38
Actual: 1ac6bb16e829e9f3a58f62c27047c26784975aa1
Archive: /Library/Caches/Homebrew/sphinx--stemmer-c.tgz
To retry an incomplete download, remove the file above.

Same error after removing the sphinx--stemmer-c.tgz

@benoitr

This comment has been minimized.

Copy link

benoitr commented Nov 15, 2014

@VVCepheiA I have the same issue, do you find a fix?

@nasospsa

This comment has been minimized.

Copy link

nasospsa commented Nov 18, 2014

@paulomcnally

This comment has been minimized.

Copy link

paulomcnally commented Nov 19, 2014

ruby-2.1.5| Paulos-MacBook-Pro in ~/develop/test/audio
○ → brew install sphinx
==> Downloading http://sphinxsearch.com/files/sphinx-2.2.5-release.tar.gz
Already downloaded: /Library/Caches/Homebrew/sphinx-2.2.5.tar.gz
==> Downloading http://snowball.tartarus.org/dist/libstemmer_c.tgz
Already downloaded: /Library/Caches/Homebrew/sphinx--stemmer-c.tgz
Error: SHA1 mismatch
Expected: 9b0f120a68a3c688b2f5a8d0f681620465c29d38
Actual: 1ac6bb16e829e9f3a58f62c27047c26784975aa1
Archive: /Library/Caches/Homebrew/sphinx--stemmer-c.tgz
To retry an incomplete download, remove the file above.
@mrichman

This comment has been minimized.

Copy link

mrichman commented Dec 8, 2014

+1 for @paulomcnally's issue:

$ brew install sphinx
==> Downloading http://sphinxsearch.com/files/sphinx-2.1.9-release.tar.gz
Already downloaded: /Library/Caches/Homebrew/sphinx-2.1.9.tar.gz
==> Downloading http://snowball.tartarus.org/dist/libstemmer_c.tgz
######################################################################## 100.0%
Error: SHA1 mismatch
Expected: bbe1ba5bbebb146575a575b8ca3342aa3b91bf93
Actual: 1ac6bb16e829e9f3a58f62c27047c26784975aa1
Archive: /Library/Caches/Homebrew/sphinx--stemmer-c.tgz
To retry an incomplete download, remove the file above.
@prostil

This comment has been minimized.

Copy link

prostil commented Dec 12, 2014

I had the same error but surprisingly it was resolved by doing this

  1. Remove the .tgz from /Library/Caches/Homebrew/
  2. run : brew update
  3. brew install sphinx

After sphinx is installed you can install either mysql connector or PostreSQL, at the end of sphinx installation you will get the commands that you need to run

@shivanibhanwal

This comment has been minimized.

Copy link

shivanibhanwal commented Aug 18, 2015

Now to install sphix with mysql you should use

brew install sphinx --with-mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.