conflicting cygwin and windows path

和自甴很熟 提交于 2019-12-23 10:14:54

问题


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.


回答1:


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 e.g.:

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.



来源:https://stackoverflow.com/questions/2613586/conflicting-cygwin-and-windows-path

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!