Cygwin /cygdrive/c no such file or directory

SnakeWasTheNameTheyGaveMe picture SnakeWasTheNameTheyGaveMe · Sep 2, 2014 · Viewed 26.5k times · Source

Host system: Windows Server 2008 32-bit
Installed: Cygwin

I don't know when this problem started, but one of my Rails gems uses the command which to determine the location of a system-installed executable. In my circumstance, it returns /cygdrive/c/Windows/System32/pngcrush - and the file is inaccessible.

In both cygwin terminal and Windows cmd I get the following:

ls -la /cygdrive/c = No such file or directory

mount =

C:/cygwin/bin on /usr/bin type ntfs (binary,auto)
C:/cygwin/lib on /usr/lib type ntfs (binary,auto)
C:/cygwin on / type ntfs (binary,auto)
B: on /cygdrive/b type smbfs (binary,posix=0,user,noumount,auto
C: on /cygdrive/c type ntfs (binary,posix=0,user,noumount,auto)

Running cd / in Windows terminal brings me to C:\

cd /cygdrive = The system cannot find the path specified

FURTHER EDIT:

I can access the drives using /c for example, but just not /cygdrive/c which is what which returns.

Answer

SnakeWasTheNameTheyGaveMe picture SnakeWasTheNameTheyGaveMe · Sep 3, 2014

I found the answer on superuser.com; moving C:\cygwin\bin to the front of the PATH variable fixed the issue.