11

I've installed Vagrant, Vagrant init worked fine. When I now run Vagrant up I get this error:

The executable 'cygpath' Vagrant is trying to run was not
found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path.

Im using cygwin as terminal and I have windows 8, and I've placed C:\cygwin64\bin in my PATH in envoirment variables.

My question is, why do I get this error message when I've specified the path to my cygwin bin?

Thanks!

Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
user2354898
  • 253
  • 2
  • 15
  • Have you checked if the given path is on your path variable? Did you try to print it to see what comes out? – Eber Freitas Dias Dec 28 '15 at 22:56
  • can you add `p ENV['PATH']` in your Vagrantfile and make sure the PATH uses in your session is the one you set, you should see `C:\cygwin64\bin` if you added there – Frederic Henri Jan 19 '16 at 13:53

4 Answers4

9

I am assuming you have Cygwin installed, simply add the path to cygwin (usually c:\cygwin\bin\cygwin.exe) to your shells %path% variable and you should be ready to go.

  • Ctrl-X => System => Advanced Settings => Variables
  • Restart your Powershell/Cmd-Window
4

I just experienced the same error after removing cygwin, and figured out that the answer is not in reinstalling it, but simply removing it from the %Path%, so that Vagrant wouldn't search for it when booting.

So, you can open Control Panel => System => Advanced System Settings => Environment Variables... And then find Path under System Variables, and remove any references to cygwin.

Restart your shell, and you're good to go.

Clone
  • 535
  • 1
  • 6
  • 14
  • 1
    This was actually my problem. I think it may be because I've had Vagrant installed in the past, or otherwise mucked about with my path. Anyway, after removing cygwin from the path Vagrant ran without issue. – pzkpfw Aug 15 '16 at 03:46
2

My soultion was to create a small wrapper script, vagrant.bat:

@setlocal
@set PATH=C:\HashiCorp\Vagrant\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem
@vagrant %*
@endlocal

The vagrant.bat file is in a directory that is first in my PATH.

slu
  • 1,244
  • 9
  • 14
0

I suddenly had the same problem and found that for some reason Cygwin had been erased from the system (I was running from git bash shell). I reinstalled Cygwin and it then worked again.

cb2
  • 679
  • 9
  • 15