可执行文件未从PATH变量中搜索到。

huangapple go评论93阅读模式
英文:

Executable not searching from PATH variable

问题

我正在尝试在我的MAC上构建Grafana。我已经安装了Go二进制文件并更新了PATH变量。下面是bash的输出:

bash-3.2$ echo $PATH /Users/kartl/Projects/mongodb/bin/:/usr/local/go/bin/go:/usr/local/sbin:/Users/kartl/.npm-packages/bin:/Users/kartl/Projects/mongodb/bin/:/usr/local/sbin:/Users/kartl/.npm-packages/bin:/Users/kartl/Projects/mongodb/bin/:/usr/local/sbin:/Users/kartl/.npm-packages/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/bin/jamf

但是当我尝试运行一些Go安装命令时,我遇到了以下错误:

/Users/kartl/Projects/grafana/bin/godep  restore 
godep: restore: exec: "go": 在$PATH中找不到可执行文件
godep: restore: exec: "go": 在$PATH中找不到可执行文件
godep: restore: exec: "go": 在$PATH中找不到可执行文件

有人可以帮我解决这个问题吗?

英文:

I am trying to build grafana on my MAC. I installed the go binary and updated the PATH variable.Below is the output of bash

bash-3.2$ echo $PATH
/Users/kartl/Projects/mongodb/bin/:/usr/local/go/bin/go:/usr/local/sbin:/Users/kartl/.npm-packages/bin:/Users/kartl/Projects/mongodb/bin/:/usr/local/sbin:/Users/kartl/.npm-packages/bin:/Users/kartl/Projects/mongodb/bin/:/usr/local/sbin:/Users/kartl/.npm-packages/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/bin/jamf

But when I am trying to run some go command for installation, I get below errors.

/Users/kartl/Projects/grafana/bin/godep  restore 
godep: restore: exec: "go": executable file not found in $PATH
godep: restore: exec: "go": executable file not found in $PATH
godep: restore: exec: "go": executable file not found in $PATH

Can someone help me as why is this happening ?

答案1

得分: 2

/usr/local/go/bin/go 应该是 /usr/local/go/bin 才对吗?
PATH 变量中的项应该是包含可执行文件的目录,而不是可执行文件本身。

英文:

Shouldn't /usr/local/go/bin/go be /usr/local/go/bin?
The items in the PATH variable should be directories containing executables, not the executables themselves.

huangapple
  • 本文由 发表于 2015年10月6日 13:04:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/32962085.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定