just use Homebrew to run brew install postgis directly in the terminal
==> Installing dependencies for postgis: libpng, jpeg, giflib, libtiff, libgeotiff, libxml2, pcre, freexl, libspatialite, gdal, boost, gmp, mpfr, cgal, sfcgal
Error: Calling keg_only :provided_pre_mountain_lion is disabled!
There is no replacement.
/usr/local/Homebrew/Library/Homebrew/formula.rb:1035:in `keg_only?
Excuse me, what does this Error mean? How should it be solved?