I know this is an old question that has several answers on the web. I have been following the thread How to fix pg_dump version mismatch errors? But none of them seems to be working.
Issue:
pg_dump: error: server version: 14.5 (Debian 14.5-2.pgdg110+2); pg_dump version: 13.1
Additional info:
pg_dump --version
pg_dump (PostgreSQL) 13.1
which pg_dump
/usr/local/bin/pg_dump
echo $PATH
/Users/prajeeshb/.nvm/versions/node/v14.16.0/bin:/Users/prajeeshb/.rvm/gems/ruby-3.1.0/bin:/Users/prajeeshb/.rvm/gems/ruby-3.1.0@global/bin:/Users/prajeeshb/.rvm/rubies/ruby-3.1.0/bin:/Users/prajeeshb/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin
I am using mac and i tried to put this at the top of .profile file
export PATH="/Applications/PostgreSQL\ 10/pgAdmin\ 4.app/Contents/MacOS/applet:$PATH"
and then run
. ~/.profile
and then opening a new window and run rails db:migrate
, i am getting the same version mismatch error.
Any idea on how to fix this?
PS: I am running postgres on docker