英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论