Installing Heroku Toolbelt on Windows 10

后端 未结 6 2032
孤街浪徒
孤街浪徒 2020-12-30 03:12

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.hero

相关标签:
6条回答
  • 2020-12-30 03:19

    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.

    0 讨论(0)
  • 2020-12-30 03:21

    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

    0 讨论(0)
  • 2020-12-30 03:25

    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%"
    
    0 讨论(0)
  • 2020-12-30 03:36

    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" $@'
    
    0 讨论(0)
  • 2020-12-30 03:39

    In windows bash instead of this

    PATH="$PATH:/c/Program\ Files/Heroku/bin" 
    

    use this

     PATH="$PATH:/c/Program Files/Heroku/bin"
    
    0 讨论(0)
  • 2020-12-30 03:42

    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.

    0 讨论(0)
提交回复
热议问题