Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when doing rake db:migrate on Heroku

when doing

heroku run rake db:migrate

all migrations are performed and then, at the end I always get following message:

/app/vendor/bundle/ruby/1.9.1/bin/rake: No such file or directory - pg_dump -i -s -x -O -f /app/db/structure.sql dan79p98fykovu

I can't add pg_dump to PATH on Heroku. How to deal with this?

like image 572
Paul Avatar asked Sep 13 '12 19:09

Paul


1 Answers

The issue is that rails is trying to dump a new structure.sql once the migration is complete, and failing because pg_dump is not present. It's pointless to generate a new structure.sql for a deployed app, so the best solution is to tell rails not to.

Edit your Rakefile and override the task. Adding the following line at the end of it should do it:

Rake::Task["db:structure:dump"].clear if Rails.env.production?
like image 78
kch Avatar answered Nov 19 '22 10:11

kch