Skip to content

Instantly share code, notes, and snippets.

@terenceponce
Created September 26, 2012 08:25
Show Gist options
  • Save terenceponce/3786784 to your computer and use it in GitHub Desktop.
Save terenceponce/3786784 to your computer and use it in GitHub Desktop.
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

@prostil
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
Copy link

Now to install sphix with mysql you should use

brew install sphinx --with-mysql

@arkilis
Copy link

arkilis commented May 2, 2020

Seems like brew install sphinx --with-mysql have the following error:

Error: invalid option: --with-mysql

brew version:
Homebrew 2.2.14
Homebrew/homebrew-core (git revision 9fd5f; last commit 2020-05-02)
Homebrew/homebrew-cask (git revision 0aca0; last commit 2020-05-02)

@newadventure079
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment