Ciryo
Ciryo

Reputation: 39

Failure to run Toolbelt on Windows 7 — invalid argument 'heroku-cli.exe'

Just started digging into Heroku and I downloaded and installed Toolbelt with no problems (full install).

When I attempt to run any command however, I receive the following error:

$ heroku login

Invalid argument - "C:\Users\Veix\AppData\Local/heroku/heroku-cli.exe" version
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:107:in ``'
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:107:in `version'
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:213:in `check_if_old'
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:123:in `setup'
    C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:24:in `start'
    C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'

Invalid argument - "C:\Users\Veix\AppData\Local/heroku/heroku-cli.exe" commands --json
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:87:in ``'
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:87:in `commands_info'
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:59:in `commands'
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:208:in `find_command'
    C:/Program Files (x86)/Heroku/lib/heroku/jsplugin.rb:12:in `try_takeover'
    C:/Program Files (x86)/Heroku/lib/heroku/cli.rb:25:in `start'
    C:/Program Files (x86)/Heroku/bin/heroku:29:in `<main>'

 !    Heroku client internal error.
 !    Search for help at: https://help.heroku.com
 !    Or report a bug at: https://github.com/heroku/heroku/issues/new

Error:       Invalid argument - "C:\Users\Veix\AppData\Local/heroku/heroku-cli.exe" commands --json (Errno::EINVAL)
Command:     heroku login
Version:     heroku/toolbelt/3.42.20 (i386-mingw32) ruby/1.9.3


More information in C:/Users/Veix/.heroku/error.log

I'm running 64-bit Windows 7. I have a 64-bit version of Git (2.5.2.2) installed and also tried against the default x86 1.9.5 version that came with the installation, but without luck.

Upvotes: 3

Views: 258

Answers (1)

LukeP
LukeP

Reputation: 1605

I had this same issue happen on my machine. I went into the C:\Users\USERNAME\AppData\Local\heroku directory and tried manually running heroku-cli.exe and got the error: This program is blocked by group policy. For more information, contact your system administrator..

It turns out that the IT here has a group policy setup to block any executables from being run from the AppData directory. A quick fix for this was to copy the contents of the %appdata%\Local\heroku directory to my c:\heroku.

This will allow the program to execute but it then downloads the update for heroku back to the AppData directory again. To fix this I created a junction via cmd prompt in the %appdata%\Local to point to c:\heroku. The command is as follows:

cd C:\Users\USERNAMEHERE\AppData\Local
mklink /J heroku c:\heroku

You will see a confirmation like this:

Junction created for heroku <<===>> c:\heroku

Now you should be able to run the heroku tool-belt CLI.

Upvotes: 2

Related Questions