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.

1 Answer 1

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.

3
  • 1
    Never would have thought to do this. Thank you very much! Nov 3, 2013 at 23:22
  • Ultimately, I had to run pg_upgrade instructions as found here: 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. Nov 4, 2013 at 0: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, 2014 at 11:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.