Last active
December 21, 2015 22:49
-
-
Save ian29/6378206 to your computer and use it in GitHub Desktop.
easiest way to install postgres (and postgis) on mac os x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash | |
# make sure homebrew is up-to-date and install some stuff | |
brew update | |
brew install postgres || brew upgrade postgres | |
brew install postgis || brew upgrade postgis | |
# if you dont have brew on your path yet | |
echo "export PATH=/usr/local/bin:$PATH" >> ~/.bash_profile | |
source ~/.bash_profile | |
# start postgres | |
initdb /usr/local/var/postgres -E utf8 | |
pg_ctl -D /usr/local/var/postgres -l ~/.pg_log start |
CAVEAT
when i run
psql test -c "create extension postgis"
i receive the following error:
ERROR: could not load library "/usr/local/Cellar/postgresql/9.2.4/lib/postgis-2.1.so": dlopen(/usr/local/Cellar/postgresql/9.2.4/lib/postgis-2.1.so, 10): Library not loaded: /usr/local/lib/libgeos_c.1.8.0.dylib
Referenced from: /usr/local/Cellar/postgresql/9.2.4/lib/postgis-2.1.so
Reason: image not found
for some reason postgis.2.1.0 is referencing /usr/local/lib/libgeos_c.1.8.0.dylib
, but brew installs v3.4.x. as a workaround i just did
ln -s /usr/local/lib/libgeos_c.dylib /usr/local/lib/libgeos_c.1.8.0.dylib
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
brew info postgres
will set you free