12

I'm attempting to deploy my Java web app on Heroku. When I was making a tutorial I've created an app using heroku create command, lets say it wasy "name-app1". Then I removed it after the tutorial and create the new one to deploy it let it be: "new_app". However, when I attempt to do anything like upload my code there was an error that previous app "name-app1" does not exist anymore. When I try to use for e.g. heroku logs there is following error:

 »   Error: Missing required flag:
 »     -a, --app APP  app to run command against
 »   See more help with --help

I tired to point at my new app with following command:

git remote set-url heroku git@heroku.com:hidden-ridge-8790.git

I think I messed up something and don't know how to fix it.

Luke_Nuke
  • 461
  • 2
  • 6
  • 23

3 Answers3

40

The way you try to set your remote for heroku is incorrect. That is why you get the above error. To set your remote correctly use the below command

heroku git:remote -a new_app

This will set your remote to newly crated app new_app

To deploy the code use below command

git push heroku master

This will deploy your code to heroku app

Azkar Moulana
  • 854
  • 1
  • 8
  • 14
4

You're close,

heroku git:remote -a hidden-ridge-8790

is the same as:

git remote add heroku git@heroku.com:hidden-ridge-8790.git

give those a try, if that doesn't work show us the output of git remote -v and we can get you straightened out.

John Beynon
  • 37,398
  • 8
  • 88
  • 97
2

Try this one

heroku git:remote -a your_local_app

heroku run rails c