2015-04-22 53 views
0

我已經在Ubuntu的版本上安裝了2個postgres服務器:9.3.6;版本:9.2.6。我如何定義在rails中使用哪個pg_dump版本。錯誤轉儲數據庫與2 postgres服務器

$ 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/[email protected]/gems/activerecord-4.1.0/lib/active_record/tasks/postgresql_database_tasks.rb:55:in `struct> 
    /home/pair/.rvm/gems/[email protected]/gems/activerecord-4.1.0/lib/active_record/tasks/database_tasks.rb:150:in `structure_dump' 
    /home/pair/.rvm/gems/[email protected]/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:269:in `block (3 levels)> 
    /home/pair/.rvm/gems/[email protected]/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:43:in `block (2 levels) > 
    /home/pair/.rvm/gems/[email protected]/gems/activerecord-4.1.0/lib/active_record/railties/databases.rake:37:in `block (2 levels) > 
    /home/pair/.rvm/gems/[email protected]/bin/ruby_executable_hooks:15:in `eval' 
    /home/pair/.rvm/gems/[email protected]/bin/ruby_executable_hooks:15:in `<main>' 
    Tasks: TOP => db:structure:dump 
    (See full trace by running task with --trace) 

數據庫配置:

development: 
    adapter: postgresql 
    encoding: unicode 
    database: tradeapp_development 
    pool: 5 
    username: postgres9_3 
    password: postgres9_3 
    host: localhost 
    port: 5434 
+1

之前,你可以在這裏找到答案:HTTP://計算器。 COM /問題/ 12836312/PostgreSQL的-9-2-PG-轉儲版本不匹配 – cristian

回答

1

我的解決辦法:定義PATH可變遷移所需的Postgres bin目錄

export PATH="/usr/lib/postgresql/9.3/bin/:$PATH" 
rake db:migrate 
相關問題