I just installed posgresql with homebrew and when I go on to type the command
psql
I get the following error:
dyld: Library
I was getting the exact same error, but the above answers didn't work for me. I had to reinstall postgresql.
brew reinstall postgresql