brew update and retried your prior step?brew doctor, fixed as many issues as possible and retried your prior step?I am trying to install PostGIS. It appears to install properly but when I try to add the extension to my database it fails:
# create extension postgis;
ERROR: could not open extension control file "/Applications/Postgres.app/Contents/Versions/9.6/share/postgresql/extension/postgis.control": No such file or directory
There is currently no /Applications/Postgres.app on my system. I'm guessing there is some cruft on my system somewhere, but I have no idea where. I note from https://libraries.io/homebrew/postgis/2.3.1 that 2.3.1 support is imminent but I have no idea whether this is relevant.
HOMEBREW_VERSION: 1.1.6-9-g98dadd9
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 98dadd907e31bb5f9a16bfb6aa2138b1852c4db5
Last commit: 11 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 003288022cf4b026fa96f670514227d4edaa0682
Core tap last commit: 7 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 8.0 build 800
Git: 2.10.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
Java: 1.8.0_72
macOS: 10.11.6-x86_64
Xcode: 8.2
CLT: 8.2.0.0.1.1480973914
X11: N/A
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: The filesystem on / appears to be case-sensitive.
The default macOS filesystem is case-insensitive. Please report any apparent problems.
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libgeos.3.6.0dev.dylib
/usr/local/lib/libgeos_c.1.10.0.dylib
postgis: stable 2.3.0 (bottled), HEAD
Adds support for geographic objects to PostgreSQL
http://postgis.net
/usr/local/Cellar/postgis/2.3.0_1 (184 files, 69.6M) *
Poured from bottle on 2017-01-04 at 17:27:10
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/postgis.rb
==> Dependencies
Build: pkg-config โ, gpp โ
Required: postgresql โ, proj โ, geos โ, json-c โ, pcre โ
Recommended: gdal โ, sfcgal โ
==> Options
--with-api-docs
Generate developer API documentation (long process)
--with-gui
Build shp2pgsql-gui in addition to command line tools
--with-html-docs
Generate multi-file HTML documentation
--without-gdal
Disable postgis raster support
--without-sfcgal
Build without sfcgal support
--HEAD
Install HEAD version
==> Caveats
To create a spatially-enabled database, see the documentation:
http://postgis.net/docs/manual-2.2/postgis_installation.html#create_new_db_extensions
If you are currently using PostGIS 2.0+, you can go the soft upgrade path:
ALTER EXTENSION postgis UPDATE TO "2.3.0";
Users of 1.5 and below will need to go the hard-upgrade path, see here:
http://postgis.net/docs/manual-2.2/postgis_installation.html#upgrading
PostGIS SQL scripts installed to:
/usr/local/opt/postgis/share/postgis
PostGIS plugin libraries installed to:
/usr/local/lib
PostGIS extension modules installed to:
/usr/local/share/postgresql/extension
postgresql: stable 9.6.1 (bottled), HEAD
Object-relational database system
https://www.postgresql.org/
Conflicts with: postgres-xc
/usr/local/Cellar/postgresql/9.6.1 (3,242 files, 36.4M) *
Poured from bottle on 2017-01-04 at 17:27:08
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/postgresql.rb
==> Dependencies
Required: openssl โ, readline โ
==> Requirements
Optional: python โ, python3 โ
==> Options
--with-dtrace
Build with DTrace support
--with-python
Enable PL/Python2
--with-python3
Enable PL/Python3 (incompatible with --with-python)
--without-perl
Build without Perl support
--without-tcl
Build without Tcl support
--HEAD
Install HEAD version
==> Caveats
If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
https://github.com/Homebrew/homebrew/issues/2510
To migrate existing data from a previous major version (pre-9.0) of PostgreSQL, see:
https://www.postgresql.org/docs/9.6/static/upgrading.html
To migrate existing data from a previous minor version (9.0-9.5) of PostgreSQL, see:
https://www.postgresql.org/docs/9.6/static/pgupgrade.html
You will need your previous PostgreSQL installation from brew to perform pg_upgrade.
Do not run brew cleanup postgresql until you have performed the migration.
To have launchd start postgresql now and restart at login:
brew services start postgresql
Or, if you don't want/need a background service you can just run:
pg_ctl -D /usr/local/var/postgres start
The way I resolved this was by:
rm -r /usr/local/var/postgresfind / -name "postg*" that look suspicious (in my case they were in ~/Library)brew uninstall...brew install postgisYou are a lifesaver! ๐ Here's a ๐ฎ for you.
@jyutzler You are great, thanks a lot. I met the same problem when installed timescaledb
I had the same problem and it took me like two days to solve it.
I create a new postgis.control file manually and copied the contents from the plpgsql.control file and putted on it.
Then it said that I was missing the postgis--1.0.sql.
I did the same, and created it manually and left it empty.
Before doing all this I simply ran "CREATE EXTENSION postgis;"
Most helpful comment
The way I resolved this was by:
rm -r /usr/local/var/postgresfind / -name "postg*"that look suspicious (in my case they were in~/Library)brew uninstall...brew install postgisFrom there I was able to return to the normal instructions, create the extension, and I was off to the races.