问题
When running psql -d mydb -c "CREATE EXTENSION postgis;"
I get the following error:
ERROR: could not load library "/usr/local/Cellar/postgresql/9.3.4/lib/rtpostgis-2.1.so": dlopen(/usr/local/Cellar/postgresql/9.3.4/lib/rtpostgis-2.1.so, 10): Symbol not found: _sqlite3_column_table_name
Referenced from: /usr/local/lib/libgdal.1.dylib
Expected in: /usr/lib/libsqlite3.dylib
in /usr/local/lib/libgdal.1.dylib
STATEMENT: CREATE EXTENSION postgis;
System: OS X 10.9.2
All libraries were installed with homebrew.
I tried reinstalling 'gdal', 'geos', 'postgresql', 'postgis' with homebrew without any luck. I'm suspecting it may be something related to sqlite3, but not sure.
回答1:
The issue was that it was using the sqlite3 library that is installed by default by OS X. After linking the brewed library using brew link sqlite3 --force
I was able to create the postgis extension.
回答2:
I encountered the same issue. My fix was :
brew link --overwrite jpeg
Hope this helps!
来源:https://stackoverflow.com/questions/23269978/error-creating-a-spatial-database-using-extensions