0

Normally, when I deploy to Heroku, I create the heroku app from within the Rails console with the command

heroku create mycustomappname

and then it creates that heroku url

http://mycustomappname.herokuapp.com

and then when I push to heroku, the app is available at that custom domain.

However, after creating a canvas app on Facebook, and selecting Heroku to host, Facebook gave me the heroku url. I have a rails app on my local host. How do I push to that specific heroku url if it wasn't created from within the Rails console?

Leahcim
  • 40,649
  • 59
  • 195
  • 334

1 Answers1

1

Run this from the console:

heroku git:remote -a <heroku url>

This will add a remote for the heroku url to your git config. See also this article.

Roddy of the Frozen Peas
  • 14,380
  • 9
  • 49
  • 99
  • Thanks, but I got an error. Do you happen to know how I would deal with this? " To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. " – Leahcim Sep 13 '12 at 21:41
  • @Michael -- You could force it via `git push -f` to force your changes through to heroku, then a `git pull`. See [this question](http://stackoverflow.com/questions/5509543/how-to-properly-force-a-git-push). – Roddy of the Frozen Peas Sep 13 '12 at 21:48
  • Thanks, but I can't figure out what I put after 'git pull'. Pull what? The name of the Heroku url? Be grateful if you can assist. Note, I did the git push -f, and it worked, but now confused about the git pull – Leahcim Sep 13 '12 at 22:35
  • @Michael - `git pull` is the equivalent of `svn update` -- it pulls down the changes in the repository so that your local repo and the heroku repo are the same. It should be unnecessary in this case. Once you do a `git push` you should have forced your changes to the the heroku app. You should be good to go now. – Roddy of the Frozen Peas Sep 13 '12 at 22:43