I'm getting the following error whenever I run rake tasks on my Rails app's database.
pg_dump: server version: 9.2.4; pg_dump version: 9.1.5
pg_dump: aborting because of server version mismatch
I've Googled around, and found some suggestions about updating the postgres brew package, but this did not work.
Why is the incorrect pg_dump version being used, and how can I fix this? Or what search terms should I be looking for to find a solution?
EDIT
Info on my pg_dump configuration:
$ pg_dump --version
> pg_dump (PostgreSQL) 9.1.5
$ which pg_dump
> /usr/bin/pg_dump
$ echo $PATH
> /Users/andrewharvey/.rvm/gems/ruby-1.9.3-p392@mantawatch/bin:/Users/andrewharvey/.rvm/gems/ruby-1.9.3-p392@global/bin:/Users/andrewharvey/.rvm/rubies/ruby-1.9.3-p392/bin:/Users/andrewharvey/.rvm/bin:/usr/local/heroku/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/andrewharvey/.rvm/bin
I'm using oh_my_zsh, and path is defined in my .zshrc file. This may be the cause of my problem (and I'm sure this can be cleaned up), unfortunately I don't know enough what I'm doing to debug and edit this. Grateful for pointers (I'm using RVM and postgres installed via Homebrew).
source $ZSH/oh-my-zsh.sh
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
alias pg='pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log'
export
PATH=$PATH:/usr/local/bin:/Users/andrewharvey/.rvm/gems/ruby-2.0.0-p0/bin:/Users/andrewharvey/.rvm/gems/ruby-2.0.0-p0@global/bin:/Users/andrewharvey/.rvm/rubies/ruby-2.0.0-p0/bin:/Users/andrewharvey/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"