I would say there are several ways to handle this problem
restarting heroku
Run $ heroku restart
in the rails dir. Sometimes I believe in magic.
debugging
Use $ heroku log
to debug what is causing the error.
migrate database
Perhaps you made a database change in local rails, while heroku rails didn't.
Run heroku run rake db:migrate
drop database and remigrate database
See this thread. Sometimes old migration might be in conflict with current migration. Do a clean migration, if the data in your database isn't important.
recreate heroku instance
run $ heroku apps:destroy –app appname
and replace appname
with your appname. Then delete the current heroku
remote repository location from git. git remote rm heroku
. Then recreate heroku. run $ heroku create
. go through pushing your code and migrating database like usual.