I can\'t get rake db:migrate to run on my rails 4.0.1 app on Heroku.
I\'m guessing that I don\'t have postgres configured properly... but reading the docs on heroku
Run
heroku pg:reset DATABASE_URL
and you are done.
I should've read the stack trace more closely. My factories.rb was creating user objects as attributes for other factories. Wrapping them in a block fixed it:
FactoryGirl screws up rake db:migrate process
I would first try
heroku restart
heroku rake db:migrate
If that doesn't work, then try.
heroku pg:reset DATABASE_URL #Literally type in heroku pg:reset DATABASE_URL
heroku rake db:migrate
To drop and recreate database
heroku pg:reset DATABASE
Jason's answer might fix your problem, but I wanted to expand on why you got the error and how to fix it.
You can't run "rake db:setup" on Heroku, because it will try to create a database, and your database already exists on Heroku
In your database.yml, you should read the database url from the environment variable like:
production: url: <%= ENV["DATABASE_URL"] %>
I think you are getting the 2nd error because you have some version error in your migrations, runing them from the begining should fix it :
rake db:migrate VERSION=0