Windows- Installing Heroku CLI - heroku

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?

Related

Installed Heroku but not recognised

I installed git and Heroku on my Windows8.1 64bit machine. On running:heroku --version I get the following error:
bash: heroku: command not found
What must I do to enable it?
Installing Heroku Toolbelt on Windows 10
bash: heroku: command not found
The error message is clear: Bash cannot find the heroku command, it's not on your PATH.
I checked, and the Heroku folder was added to the PATH.
It seems you didn't check it correctly.
Note that even if it looks correct in the PATH settings window,
Git Bash might have a different PATH configured.
To see the PATH in Git Bash, run:
echo $PATH
When debugging path issues,
it's best to first run heroku with the absolute path. For example if it's in C:\Program Files\Heroku\bin\heroku then you can run in Git Bash with:
/c/Program\ Files/Heroku/bin/heroku login
If this works (and it should),
then you can add it to PATH like this:
PATH="$PATH:/c/Program\ Files/Heroku/bin"
Note that Heroku will likely need other programs too on the PATH,
such as MySQL and Ruby.
Find their absolute paths,
and add there directories to PATH the same way as heroku itself in the above example.
If instead of Git Bash,
you want to work in CMD,
the procedure is the same,
but the syntax to print and set PATH is different:
echo %PATH%
set PATH="C:\Program Files\Heroku\bin;%PATH%"

How to understand PATH vs $PATH$ on different command line interfaces

I ran the command heroku version on my Windows CLI, and it returned the version of Heroku I have.
But when I do the same on my Windows Gitbash CLI, it says:
Doesha#Bub-PC MINGW32 ~
$ heroku version
/c/Program Files/Heroku/bin/heroku: line 4: /c/Program Files/Heroku/ruby-1.9.3/bin/ruby: No such file or directory
When I look at my path variables using the PATH command on my Windows CLI, my path looks like this:
C:\Users\Doesha>PATH
PATH=C:\Program Files\ImageMagick-6.9.2-Q16;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;
When I look at my path variables using the $PATH$ command on my Windows Gitbash CLI, my path looks like this:
Doesha#Bub-PC MINGW32 ~
$ $PATH$
bash: /c/Users/Doesha/bin:/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/mingw32/bin:/usr/bin:/c/Users/Doesha/bin:/c/Program Files/ImageMagick-6.9.2-Q16:/c/ProgramData/Oracle/Java/javapath:/c/WINDOWS/system32:
Can someone tell me why my paths for both CLI's look different? (For example C:\Program Files\ImageMagick-6.9.2-Q16; and /c/Program Files/ImageMagick-6.9.2-Q16: look different).
Does each CLI have it's own set of path variables?
If so, how can I set up Heroku so that it can be added to my Windows Gitbash CLI path variables also?
The PATH will be different in an msys2 Git bash session since / represent where git is installed (with /etc/, /usr/, ... being the subfolder you see in your Git installation folder).
(see also "How are msys, msys2, and msysgit related to each other?")
Check that the /c/Program Files/Heroku/ruby-1.9.3/bin/ruby knowing that it is case sensitive in the bash session (it is not in a CMD Windows session).

Installing Heroku Toolbelt on Windows 10

I've been having some issues installing the Heroku toolbelt on Windows 10, 64-bit.
It's the first time I install Heroku. I downloaded it from https://toolbelt.heroku.com/windows.
After installing, I tried launching a new Git Bash and typing heroku login but what I got back was bash: heroku: command not found
Running the same command on Windows Powershell, what I got back was
'MYSQL' is not recognized as an internal or external command,
operable program or batch file.
'MYSQL' is not recognized as an internal or external command,
operable program or batch file.
Any suggestions? I thought that googling those lines would help, but I haven't found much.
I followed the recommendation from here, but now when typing heroku login on the Powershell, nothing happens. Nothing changes on the Git Bash.
I checked, and the Heroku folder was added to the PATH.
I thought I'd ask for some help before installing anything else.
Thank you!
bash: heroku: command not found
The error message is clear: Bash cannot find the heroku command, it's not on your PATH.
I checked, and the Heroku folder was added to the PATH.
It seems you didn't check it correctly.
Note that even if it looks correct in the PATH settings window,
Git Bash might have a different PATH configured.
To see the PATH in Git Bash, run:
echo $PATH
When debugging path issues,
it's best to first run heroku with the absolute path. For example if it's in C:\Program Files\Heroku\bin\heroku then you can run in Git Bash with:
/c/Program\ Files/Heroku/bin/heroku login
If this works (and it should),
then you can add it to PATH like this:
PATH="$PATH:/c/Program\ Files/Heroku/bin"
Note that Heroku will likely need other programs too on the PATH,
such as MySQL and Ruby.
Find their absolute paths,
and add there directories to PATH the same way as heroku itself in the above example.
If instead of Git Bash,
you want to work in CMD,
the procedure is the same,
but the syntax to print and set PATH is different:
echo %PATH%
set PATH="C:\Program Files\Heroku\bin;%PATH%"
In windows bash instead of this
PATH="$PATH:/c/Program\ Files/Heroku/bin"
use this
PATH="$PATH:/c/Program Files/Heroku/bin"
My working solution (for git-bash especially) is:
alias heroku='winpty `where heroku.cmd`'
stored in .bashrc in home user dir
and them
heroku
works as expected
If using bash from VSCode, I had to restart VSCode, after installing heroku. If not using VSCode, you probably need to restart your bash terminal, after installing heroku.
In Control Panel\All Control Panel Items\System (if you are using Windows), go to Advanced system settings, and there in Environment Variables, you'll find two lists, on the same window, viz. System variables, and User variables for your system. Make sure you add your path, viz. C:/Program Files/Heroku/bin, in both of these lists.
I know this is an old thread and just want to share my solution.
Edit .bashrc for git-bash
alias heroku='"C:\Program Files\Heroku\bin\heroku.cmd" $#'

Heroku Toolbelt - Installed, yet Heroku Command not working

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.

Unable to run git from command line

I have installed GIT for Windows right now. And when I am running this into my symfony project to reinstall the vendors by
php bin/vendors install --reinstall
Then i am getting an error
git' is not recognized as internal or external command
I have set the environmental variables also as
c:/programme files/git/cmd
Now what should I do?
I have tried also for environmental variables
c:/program files/git/bin
but I am getting the same error
Two possible solutions:
My PATH has backslashes instead of forward ones.
your first line contains a typo, should be c:\program files\git\cmd
One more: If your path includes spaces, enclose it in quotes:
set PATH=%PATH%;"C:\Program Files\Git\cmd"
During Git installation, in the path environment settings chose the following one.
Even I had the same problem, of git not executed on my normal Command Line, but i just reinstalled it with the setting "Run Git from the Windows Command Prompt"
Just open cmd and run this command:
set PATH=%PATH%;"C:\Program Files\Git\cmd"

Resources