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
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