0

I have installed 2 postgres servers on ubuntu version: 9.3.6; version: 9.2.6. How can i define which pg_dump version to use in rails.

  $ rake db:migrate
  pg_dump: server version: 9.3.6; pg_dump version: 9.2.6
  pg_dump: aborting because of server version mismatch
  rake aborted!
  Error dumping database
  /home/pair/.rvm/gems/ruby-2.0.0-p481@uptick/gems/activerecord-4.1.0/lib/active_record/tasks/postgresql_database_tasks.rb:55:in `struct>
  /home/pair/.rvm/gems/ruby-2.0.0-p481@uptick/gems/activerecord-4.1.0/lib/active_record/tasks/database_tasks.rb:150:in `structure_dump'
  /home/pair/.rvm/gems/ruby-2.0.0-p481@uptick/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:269:in `block (3 levels)>
  /home/pair/.rvm/gems/ruby-2.0.0-p481@uptick/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:43:in `block (2 levels) >
  /home/pair/.rvm/gems/ruby-2.0.0-p481@uptick/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:37:in `block (2 levels) >
  /home/pair/.rvm/gems/ruby-2.0.0-p481@uptick/bin/ruby_executable_hooks:15:in `eval'
  /home/pair/.rvm/gems/ruby-2.0.0-p481@uptick/bin/ruby_executable_hooks:15:in `<main>'
  Tasks: TOP => db:structure:dump
  (See full trace by running task with --trace)

Database config:

development:
  adapter: postgresql
  encoding: unicode
  database: tradeapp_development
  pool: 5
  username: postgres9_3
  password: postgres9_3
  host: localhost
  port: 5434
djsmentya
  • 315
  • 1
  • 12
  • 1
    You can find your answer here: http://stackoverflow.com/questions/12836312/postgresql-9-2-pg-dump-version-mismatch – cristian Apr 22 '15 at 12:01

1 Answers1

3

My solution: to define PATH variable before migration to required postgres bin dir

export PATH="/usr/lib/postgresql/9.3/bin/:$PATH"
rake db:migrate
djsmentya
  • 315
  • 1
  • 12