13

I have installed Postgis and Postgresql through Homebrew on my Mac, and I wanted to upgrade my version of Postgis to 2.1.0-rc2. I unlinked my version of postgis, and then edited the postgis homebrew formula. After the new formula did not compile, I relinked the old formula and I now receive the following error whenever I try to invoke a database table with a spatial column:.

PG::UndefinedFile: ERROR:  could not load library 
"/usr/local/Cellar/postgresql/9.2.4/lib/postgis-2.0.so":   
dlopen(/usr/local/Cellar/postgresql/9.2.4/lib/postgis-2.0.so, 10): Symbol not found: 
_json_tokener_errors
Referenced from: /usr/local/Cellar/postgresql/9.2.4/lib/postgis-2.0.so
Expected in: /usr/local/lib/libjson.0.dylib
in /usr/local/Cellar/postgresql/9.2.4/lib/postgis-2.0.so

(I was not having this problem prior to doing the above action) I have restarted my postgresql server, and that did not work. I am unsure of what to do to solve this issue.

tomciopp
  • 2,602
  • 2
  • 31
  • 60

1 Answers1

20

Ah! Fixed the issue by reverting to an older version of json-c that homebrew had linked. (specifically json-c 0.10) it was as simple as the following command:

brew switch json-c 0.10

Hope someone else may find this useful in the future.

tomciopp
  • 2,602
  • 2
  • 31
  • 60
  • 1
    Never would have thought to do this. Thank you very much! – Tony Pitale Nov 03 '13 at 23:22
  • Ultimately, I had to run pg_upgrade instructions as found here: http://blog.55minutes.com/2013/09/postgresql-93-brew-upgrade/ The problem was that when I ran `psql` it was 9.3.1, but the server was still 9.2.4. – Tony Pitale Nov 04 '13 at 00:49
  • Awesome! Brew somehow upgraded my json, rendering my postgis installation useless. So I had to upgrade, I thought, but even that failed, ultimately leading to this error, and this solution. Phew, lifesaver :) – nathanvda Apr 24 '14 at 11:18