简体   繁体   中英

Heroku with Rails 5.2 Error When trying to Pull the Database from Heroku to local (pg:pull)

I'm trying to replace my local DB with that from my live Heroku app.

My sausage fingers almost dropped my Heroku database instead of the local one, but I aborted almost immediately. My live site is unaffected, but when I try to run this:

heroku pg:pull DATABASE MABsecret_development

I get this error:

pg_dump: server version: 12.2 (Ubuntu 12.2-2.pgdg16.04+1); pg_dump version: 11.5
pg_dump: aborting because of server version mismatch
pg_restore: [custom archiver] could not read from input file: end of file
 ▸    pg_dump errored with 1

I've looked all over SO, but can't find a situation that parallels mine. Can anyone help me get my Heroku to be "pullable"? My local db is currently dropped and waiting!

I faced the same issue once, and I noticed that I didn't have the same version of PG installed on my local, so I uninstalled it and then installed the same version that was on the heroku.

You can check the postgresql version on heroku by opening the Heroku Postgres from add-ons list.

Try pulling the database again, after re-installing the similar version. It worked for me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM