Skip to content

Instantly share code, notes, and snippets.

@gopperman
Created October 27, 2017 15:13
Show Gist options
  • Select an option

  • Save gopperman/18cb66078372d3261420829630230b80 to your computer and use it in GitHub Desktop.

Select an option

Save gopperman/18cb66078372d3261420829630230b80 to your computer and use it in GitHub Desktop.
Install postgis-2.3.2 with postgres@9.6
brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/aa049a47b218fda30f9a4a454119ae067a02cf50/Formula/postgis.rb
#pg_config --pkglibdir is useful for finding your $libdir
cp -a /usr/local/share/postgresql/extension/postgis* /usr/local/Cellar/postgresql@9.6/9.6.5/share/postgresql@9.6/extension/
cp -a /usr/local/lib/postgresql/postgis-2.3.so /usr/local/Cellar/postgresql@9.6/9.6.5/lib/postgis-2.3
cp -a /usr/local/lib/postgresql/rtpostgis-2.3.so /usr/local/Cellar/postgresql@9.6/9.6.5/lib/
@indapublic

Copy link
Copy Markdown

I cannot create extension because:

hrm=# CREATE EXTENSION postgis;
ERROR:  could not load library "/usr/local/Cellar/postgresql@9.6/9.6.9/lib/postgis-2.3": dlopen(/usr/local/Cellar/postgresql@9.6/9.6.9/lib/postgis-2.3, 10): Library not loaded: /usr/local/opt/proj/lib/libproj.12.dylib
  Referenced from: /usr/local/Cellar/postgresql@9.6/9.6.9/lib/postgis-2.3
  Reason: image not found

gdal2 not found in brew

brew reinstall gdal2
Error: No available formula with the name "gdal2"

Tried to reinstall gdal, but it not solved problem of extension creation

@khommel

khommel commented Dec 30, 2018

Copy link
Copy Markdown

Trying to install PostGIS to work with existing Postgres 9.6. The above installed PostgreSQL 11.1, and failed to install PostGIS. Got this:

==> Pouring postgis-2.3.2.high_sierra.bottle.tar.gz
Error: undefined method `undent' for #<String:0x00007f80feb5d228>
Please report this bug:
  https://docs.brew.sh/Troubleshooting
/Users/khommel/Library/Caches/Homebrew/Formula/postgis.rb:132:in `caveats'
/usr/local/Homebrew/Library/Homebrew/caveats.rb:17:in `caveats'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/forwardable.rb:202:in `empty?'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:613:in `caveats'
/usr/local/Homebrew/Library/Homebrew/formula_installer.rb:664:in `finish'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:330:in `install_formula'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:259:in `block in install'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:257:in `each'
/usr/local/Homebrew/Library/Homebrew/cmd/install.rb:257:in `install'
/usr/local/Homebrew/Library/Homebrew/brew.rb:89:in `<main>'

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