I've installed the Heroku Toolbelt, yet "heroku" commands (like heroku version) aren't working.
Do you have any idea about what could be wrong?
Thanks!
You need to add C:\Program Files\Heroku\bin (or whatever else directory where is it installed) to your PATH.
Related
when installing Heroku CLI - I can only use the heroku in command line when I am inside \bin in my comand line. I have updated the environment variables and no other posts speak to this situation. - How can I have it act normally so I can use the commands while not in the \bin path, and actually use it for it's intended functionality. thank you!
Open windows bash and enter:
PATH="$PATH:/c/Program Files/Heroku/bin"
Heroku CLI should be added to path, you can test with:
heroku --version
what about adding these C:\Program Files\Heroku\bin in your environment variables path?
When I run $"heroku help" in my Mac OS X Terminal, I get the following error from the Heroku Cli.
$ heroku help
▸ help is not a heroku command.
▸ Perhaps you meant help
▸ Run heroku help for a list of available commands.
And it applies to every heroku command except "heroku login".
$ heroku restart
▸ restart is not a heroku command.
▸ Perhaps you meant restart
▸ Run heroku help for a list of available commands.
etc...
Is anyone else experiencing the same problem? Or how do I fix it? Thanks.
I'm having the same issue (OSX) and was able to fix it. Here's what I did.
https://devcenter.heroku.com/articles/heroku-cli#troubleshooting
That link has some trouble shooting help. It referenced a log file so I went there.
cat ~/Library/Caches/heroku/error.log
Nothing obviously wrong for me, just references to "...is not a command", but the stack traces called out the following path.
/Users/[username]/.local/share/heroku/
I deleted that folder and did another reinstall of heroku.
Everything started working for me.
One thing I noticed was that although I had ungraded heroku and it said it was installing a new version, running the following command still declared the previous version I had installed.
heroku --version
so it sounds like it's a caching issue.
I am attempting to install the Heroku CLI/Toolbelt on an bash shell version 4.3.48(1) (x86_64-pc-linux-gnu) running on Windows 10. I'm entering wget -qO- https://cli-assets.heroku.com/install-ubuntu.sh | sh in the command line, and after the packages download I'm getting the below:
Preparing to unpack .../heroku_6.14.24-1_amd64.deb ...
Unpacking heroku (6.14.24-1) ...
Setting up heroku (6.14.24-1) ...
+ which heroku
+ LOCATION=/usr/bin/heroku
+ echo heroku cli installed to /usr/bin/heroku
heroku cli installed to /usr/bin/heroku
+ heroku version
▸ Cannot create property 'exitCode' on string 'autoupdate:'
And then it just takes me back to the command line. If I try heroku --v or any other heroku CLI command I get this same error
▸ Cannot create property 'exitCode' on string 'autoupdate:'
I can't find any record of this error code anywhere online. Any thoughts? I really do not know where to start here, usually a good search at least sets me on the path but I have crickets here. Let me know if any further details are required. FWIW the toolbelt was working as of a few days ago, I just had to uninstall and reinstall my bash shell due to an unfortunate incident with Linuxbrew so am rebuilding everything from scratch.
this is fixed but the CLI might have trouble updating. Delete ~/.local/share/heroku and run heroku update and it should be fixed.
This question already has answers here:
Is there a way to set a default app for Heroku Toolbelt?
(3 answers)
Closed 1 year ago.
Heroku toolbelt is always forcing me to write an app name at the end like this:
heroku pg:reset DATABASE --app [app_name]
Is there a way to set the default app to which all my CLI heroku commands will apply?
Going to post this just in case it helps someone else out. I had the same problem even though there was only one app installed. I had to switch my heroku remote url from https to git.
https://git.heroku.com/[heroku-app-1234].git
to
git#heroku.com:[heroku-app-1234].git
Then everything worked normally for myself.
git remote remove heroku
git remote add heroku git#heroku.com:[heroku-app-1234].git
If heroku is claiming that there are multiple apps in the folder you must have more than one remote in your .git/config.
Remove the extra heroku remote or set the default using git config heroku.remote remote_name
If you have the heroku-accounts plugin installed, switching to the heroku branch worked for me, as discussed in this answer.
To swap out your existing version of the heroku-accounts plugin, use:
heroku plugins:install https://github.com/heroku/heroku-accounts.git
Note that if you've followed #Moemars answer, you'll need to switch your git remote back to https.
If you run heroku from the Git repo linked to your Heroku app, you don't have to specify an app name (unless the repo is connected to multiple apps).
This seems to be the easiest way to fix the issue:
heroku git:remote -a <app_name>
Since this wasn't mentioned until now:
Apart from the git remote, the Heroku CLI also looks into the HEROKU_APP environment variable.
By using direnv, dotenv or similar tools for project-specific environments you can easily set the respective Heroku app for each project or directory.
Attempting to set LD_LIBRARY_PATH on my heroku rails app using the heroku toolbelt on windows wrongly substitutes the paths sent to the app.
Running the following using heroku toolbelt on windows:
heroku config:add LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib:/app/vendor/phantomjs/lib
Setting config vars and restarting... done, v164
LD_LIBRARY_PATH: C:\dev\Git\local\lib;C:\dev\Git\lib;C:\dev\Git\lib;C:\dev\Git\app\vendor\phantomjs\lib
It seems the toolbelt is automatically replacing "/usr" with "C:\dev\Git\" (where msysgit is installed on my system). Obviously this breaks my heroku app because these paths do not make sense on the server.
This is actually not a problem with Heroku toolbelt, it's documented behavior by msys (I'm assuming you're running this in msysgit). You can either run the command in a different shell (eg. Powershell) or use '//' at the start of the path like this:
heroku config:add LD_LIBRARY_PATH=//usr/local/lib://usr/lib:/lib://app/vendor/phantomjs/lib
This won't cause problems when the path is used on Linux.