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
1

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.