简体   繁体   中英

conflicting cygwin and windows path

if my windows path looks like this:

c:\\ruby\\bin;c:\\cygwin\\bin

then when i go into cgywin and enter "ruby" it will execute the ruby from c:\\ruby\\bin, failing to find the ruby installed in my cygwin. I have to exclude that path so cygwin would execute the one from /usr/bin.

But i need those 2 paths, since i want to run ruby in windows too.

Anyway to have cygwin have its own path and not inherit those in windows?

thanks.

Add an entry into your .profile to set the path to whatever you want it to be in cygwin.

In cygwin run the command:

$ <favourite text editor eg vi> ~/.profile

Then set the PATH environment variable to whatever you want it to be eg:

export PATH=/cygdrive/c/cygwin/bin

NOTE I can't remember whether you can use the c:... version of the path, but if you issue the env command you will see what it should be.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM