0

I'm simultaneously working on two different Ruby on Rails apps and deploying to Heroku. However, when I try to push the 2nd app to heroku, it overwrites the first one. How can I stop this from happening?

I've gone through the different stages:

git init  git add . git commit -m "insert comment" git push heroku master 

the same as I did for the first one. What steps am I missing out?

asaignment
  • 941
  • 2
  • 8
  • 12

2 Answers2

1

It sounds to me like your problem is a result of having just one Heroku endpoint.

Did you do a heroku create?

Please comment if so and I can follow up. heroku create my-awesome-cheerio-project then follow the steps you mentioned with git push heroku master

Zargold
  • 1,892
  • 18
  • 24
1

'heroku' is just a name for your remote Heroku repository. If you are pushing two different git histories from different directories and they are overwriting one another on the URL, then they are pointing at the same remote.

Try running git remote -v from the root directory of each app. If that command returns same URL each time, then that's the issue.

Assuming this is true:

Pick one app and remove the remote with git remote remove heroku. Then create a new remote with heroku create new_shiny_app. Push your code to that remote and you're back in business.

Jake Worth
  • 5,490
  • 1
  • 25
  • 35