简体   繁体   English

冲突的cygwin和windows路径

[英]conflicting cygwin and windows path

if my windows path looks like this: 如果我的Windows路径看起来像这样:

c:\\ruby\\bin;c:\\cygwin\\bin C:\\红宝石\\ BIN; C:\\ cygwin的\\斌

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. 然后当我进入cgywin并输入“ruby”时,它将从c:\\ ruby​​ \\ bin执行ruby,无法找到我的cygwin中安装的ruby。 I have to exclude that path so cygwin would execute the one from /usr/bin. 我必须排除该路径,因此cygwin将执行/ usr / bin中的路径。

But i need those 2 paths, since i want to run ruby in windows too. 但我需要这两条路径,因为我也想在windows中运行ruby。

Anyway to have cygwin have its own path and not inherit those in windows? 无论如何让cygwin有自己的路径而不是在windows中继承它们?

thanks. 谢谢。

Add an entry into your .profile to set the path to whatever you want it to be in cygwin. 在.profile中添加一个条目,将路径设置为cygwin中您想要的路径。

In cygwin run the command: 在cygwin中运行命令:

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

Then set the PATH environment variable to whatever you want it to be eg: 然后将PATH环境变量设置为您想要的任何值,例如:

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. 注意我不记得你是否可以使用c:...版本的路径,但如果你发出env命令,你会看到它应该是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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