Reputation: 13
My app runs properly locally and has a crash when it runs on Heroku. The app does fine until I run a new_post_path call. I tried git push to see if a change to the new.html.erb file or the _form.html.erb file was the issue - but I think during the last push to heroku - my database may have taken a hit. At the time I was adding a t.text field (longtext) and it seems to be the issue.
So I wanted to roll back or totally re-start at heroku. But I have not found anyway to do it. Since this is not near production yet. Is there anyway to just create a new instance at heroku and push up to it?
Again, local version runs perfect. Thanks in advance for any ideas.
Upvotes: 0
Views: 122
Reputation: 781
Relaunching might be the least of your problems, so I suggest a few things:
Review this Heroku article on releases, including the Heroku rollback feature.
Add the PG Backups add-on to your app.
I also recommend using something like the exception_notification gem in combination with the SendGrid add-on, so that you can get an email with details on the error as well.
Upvotes: 0
Reputation: 19061
I would say there are several ways to handle this problem
Run $ heroku restart
in the rails dir. Sometimes I believe in magic.
Use $ heroku log
to debug what is causing the error.
Perhaps you made a database change in local rails, while heroku rails didn't.
Run heroku run rake db:migrate
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.
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.
Upvotes: 1