Vagrant up gives 'cygpath' Vagrant was not found in path
Asked Answered
D

4

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!

Deauville answered 25/11, 2015 at 20:18 Comment(2)
Have you checked if the given path is on your path variable? Did you try to print it to see what comes out?Postmillennialism
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 thereUnwitnessed
D
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
Diction answered 18/1, 2016 at 8:53 Comment(1)
Paths are folders, not executables. The correct path would be the path ending in "\bin\".Muslim
L
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.

Laynelayney answered 25/4, 2016 at 16:32 Comment(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.Predicative
S
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.

Sievert answered 8/7, 2016 at 7:57 Comment(0)
N
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.

Nottinghamshire answered 19/2, 2016 at 16:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.