Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku missing required flag: -a,

Tags:

heroku

I am currently doing a project and I am having issues with heroku.

Here is the mistake that always pops up when I try to use a heroku command.

Error in question

For those of you who have had the same error, what is the possible cause for this?

Thanks in advance!

like image 376
Randy Quackers Avatar asked Aug 13 '18 05:08

Randy Quackers


4 Answers

  • Initialise with git: git init

  • Get the app name: heroku apps

  • Add remote:

heroku git:remote -a your_app_name

Edit: You can also run commands without permanently adding the app

heroku run -a your_app_name

like image 103
Arindam Avatar answered Nov 09 '22 10:11

Arindam


The error is for missing app name. You must provide your app name that you want to run. Your command should be like below:

heroku run -a YOUR_APP_NAME_HERE

or

heroku run --app YOUR_APP_NAME_HERE

like image 32
Farhan Tahir Avatar answered Nov 09 '22 10:11

Farhan Tahir


When you create a Heroku app with

heroku create my-app

you need to provide the flag (-a, --app) to the add-on installation

heroku addons:create heroku-postgresql:hobby-dev --app my-app
like image 14
Robin Wieruch Avatar answered Nov 09 '22 10:11

Robin Wieruch


whenever you run some commands for effecting your heroku application, you need to set git remote to your application to work, use that by,

heroku git:remote -a your_app_name
like image 9
Ahmad Waqar Avatar answered Nov 09 '22 10:11

Ahmad Waqar