How do I fix "Library not loaded: libssl.1.0.0.dylib" with PostgreSQL?

62,131

The solution is to uninstall postgresql then install it again. The reason it wasn't working was that the Macports install messed with some of the configs.

brew reinstall postgresql

Share:
62,131
Simpleton
Author by

Simpleton

Updated on September 18, 2022

Comments

  • Simpleton
    Simpleton over 1 year

    After deleting Macports, I've had some strange behaviour. When I try to run PostgreSQL via CLI, I get:

    pawel:~ pawel$ psql
    dyld: Library not loaded: /opt/local/lib/libssl.1.0.0.dylib
      Referenced from: /usr/local/bin/psql
      Reason: image not found
    Trace/BPT trap
    

    This is strange because I've installed Postgresql through Homebrew and running brew list confirms that it's there. How would I get psql to work again?

    Additionally, trying to install the pg gem fails due to an file not found: /opt/local/lib/libssl.1.0.0.dylib error. I need to make Postgres not look in the /opt/local/ directory for this file.

  • Kenny Wyland
    Kenny Wyland about 6 years
    Thank you, I was going insane because the install would never work. I didn't realize I just needed to uninstall and retry.
  • user2821540
    user2821540 over 4 years
    brew reinstall mysql worked in case of mysql for me
  • pixelearth
    pixelearth over 4 years
    Just wanted to add that in 2020 this solved a similar problem after brew openssl was updated to 1.1.1. I was going a bit mad reinstalling ruby and the pg gem, but it turns out that postgress itself must have been compiled to look for openssl in the "old" location.
  • Kenny Evitt
    Kenny Evitt over 4 years
    Note that this might 're-install' a new (and incompatible) version of PostgreSQL!