简体   繁体   English

关于鱼中eval $ PATH的错误消息

[英]Error Message on eval $PATH in Fish

Running eval $PATH produces this message: 运行eval $ PATH会产生以下消息:

The file '/usr/local/var/rbenv/shims' is not executable by this user
- (line 1): begin; /usr/local/var/rbenv/shims /usr/local/bin /usr/local/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin 
                   ^
from sourcing file -
    called on line 60 of file /usr/local/Cellar/fish/HEAD/share/fish/functions/eval.fish    

in function 'eval'
    called on standard input

This doesn't seem to be causing any problems with rbenv, just curious as to what is causing this error message and if anyone knows how to fix it. 这似乎并没有导致rbenv出现任何问题,只是对导致此错误消息的原因以及是否有人知道如何解决它感到好奇。

This is all on OS X El Capitan with rbenv installed by homebrew. 这一切都在OS X El Capitan上,并且由Homebrew安装了rbenv。

PS: Could this have something to do with the fact that '/usr/local/var/rbenv/shims' is a directory, not a file? PS:这可能与“ / usr / local / var / rbenv / shims”是目录而不是文件有关吗? If so, why does fish think it is a file? 如果是这样,鱼为什么会认为它是文件?

eval $$PATH doesn't do what you think it does. eval $$PATH不会执行您认为的操作。 eval runs its arguments through an an extra cycle of parsing (quote and escape processing, etc) then tries to run the result as a command. eval通过一个额外的解析周期(引号和转义处理等)运行其参数,然后尝试将结果作为命令运行。 Your PATH is not going to evaluate to a valid command -- it's a list of directories where the shell looks for commands. 您的PATH不会计算出有效的命令-它是外壳程序在其中查找命令的目录列表。 Normally, I'd expect it to treat the entire bunch of directories as a single command and get an error because it's not a valid command name. 通常,我希望它会将整个目录视为一个命令,并会收到错误消息,因为它不是有效的命令名称。 In this case, it seems to be treating each directory in your PATH as a separate word (and hence treating the first as a command and the rest as arguments to that command). 在这种情况下,似乎将PATH中的每个目录都视为一个单独的单词(因此将第一个目录作为命令,其余的作为该命令的参数)。 Did you set IFS to ":" by any chance? 您是否将IFS设置为“:”?

Anyway, the solution is simple: don't use eval $PATH . 无论如何,解决方案很简单:不要使用eval $PATH I'm not sure what you wanted it to do, but whatever that was you need to find a different way to do it. 我不确定您希望它做什么,但是无论您需要什么,都需要找到一种不同的方式来做。

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

相关问题 Fish Interactive Shell 完整路径 - Fish Interactive Shell full path 在鱼启动时添加到 $PATH 的相对路径 - Add a relative path to $PATH on fish startup RVM / rbenv / 终端 $PATH 错误:(eval):18: `PATH=/usr/local/opt/...' 附近的解析错误 - RVM / rbenv / terminal $PATH error: (eval):18: parse error near `PATH=/usr/local/opt/...' `Fish` 会改变 $PATH 的顺序吗? 如何避免这种情况 - Does `Fish` change the order of $PATH? How to avoid that 奇怪的错误消息:xcode-select:错误:格式错误的开发人员路径(“/Library/Developer/CommandLineTools”) - Strange error message : xcode-select: error: malformed developer path (“/Library/Developer/CommandLineTools”) 即使我已将驱动程序位置添加到我的 PATH 中,也会弹出错误消息 - Error message popping up even though I have added the driver location to my PATH Dyld 错误消息:'库未加载:@executable_path/../../../libsteam_api.dylib' - Dyld Error Message: 'Library not loaded: @executable_path/../../../libsteam_api.dylib' 你能解释一下为什么错误“权限被拒绝”是鱼卸载的常见问题吗? - Can you explain why error “permissions denied” is a common problem with fish uninstall? fish:未知命令'__fish_pwd' - fish: Unknown command '__fish_pwd' 鱼未知命令:__fish_pwd - Fish Unknown command: __fish_pwd
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM