Heroku go-getting-started在本地无法运行。

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

Heroku go-getting-started not running localy

问题

有人知道为什么我无法在本地运行go-getting-started应用程序吗?

go get github.com/heroku/go-getting-started/cmd/...
cd $env:GOPATH/src/github.com/heroku/go-getting-started
PS C:\Users\XXXX\gocode\src\github.com\heroku\go-getting-started> heroku local
[OKAY] Loaded ENV .env File as KEY=VALUE Format
[OKAY] Trimming display Output to 107 Columns
11:28:05 PM web.1 | 'go-getting-started' is not recognized as an internal or external command,
11:28:05 PM web.1 | operable program or batch file.
[DONE] Killing all processes with signal null
11:28:05 PM web.1 Exited Abnormally
PS C:\Users\XXXX\gocode\src\github.com\heroku\go-getting-started> code .
英文:

Does anyone know why i'm unable to run the go-getting-started application localy?

go get github.com/heroku/go-getting-started/cmd/...
cd $env:GOPATH/src/github.com/heroku/go-getting-started

PS C:\Users\XXXX\gocode\src\github.com\heroku\go-getting-started> heroku  local
[OKAY] Loaded ENV .env File as KEY=VALUE Format
[OKAY] Trimming display Output to 107 Columns
11:28:05 PM web.1 |  'go-getting-started' is not recognized as an internal or external command,
11:28:05 PM web.1 |  operable program or batch file.
[DONE] Killing all processes with signal  null
11:28:05 PM web.1 Exited Abnormally
PS C:\Users\XXXX\gocode\src\github.com\heroku\go-getting-started> code .

答案1

得分: 1

根据Heroku开发中心的说明:

> 如果你看到关于未识别命令或“命令未找到”的错误,那么很可能你的$GOPATH/bin不在你的$PATH中,或者在“准备应用程序”期间使用的"go get github.com/heroku/go-getting-started/...."命令中缺少了尾部的...。

确保$GOPATH/bin(在你的情况下是C:\Users\XXXX\gocode\bin)在你的$PATH变量中。服务器二进制文件go-getting-started已经在那里,你只需要让它在命令行中可用。

英文:

According to the Heroku Dev Center:

> If you see an error about an unrecognized command or “command not found”, then $GOPATH/bin is likely not in your $PATH or the trailing ... was missing from the go get github.com/heroku/go-getting-started/.... command used during “Prepare the App”.

Make sure $GOPATH/bin (in your case, C:\Users\XXXX\gocode\bin) is in your $PATH variable. The server binary, go-getting-started, is already there, you just need to make it available to the command line.

huangapple
  • 本文由 发表于 2016年4月20日 06:34:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/36730686.html
匿名

发表评论

匿名网友

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

确定