-1

我正在尝试在我的 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": 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

有人可以帮我解释为什么会这样吗?

4

1 回答 1

2

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

于 2015-10-06T05:09:30.937 回答