gpt4 book ai didi

英雄联盟。庆典 : apiworker: command not found

转载 作者:IT王子 更新时间:2023-10-29 01:45:23 26 4
gpt4 key购买 nike

我正在关注这个 Heroku/Go 示例 https://github.com/heroku-examples/go_queue_example用于网络和工作应用程序。

通过 heroku local 运行应用程序有效,但是当部署到 Heroku 时,我收到以下command not found 错误 在日志中:

2016-03-20T11:55:51.029091+00:00 heroku[worker.1]: Starting process with command `apiworker`
2016-03-20T11:55:51.603896+00:00 heroku[worker.1]: State changed from starting to up
2016-03-20T11:55:52.842882+00:00 app[worker.1]: bash: apiworker: command not found
2016-03-20T11:55:53.624937+00:00 heroku[worker.1]: Process exited with status 127
2016-03-20T11:55:53.634515+00:00 heroku[worker.1]: State changed from up to crashed
2016-03-20T11:58:56.772069+00:00 heroku[web.1]: State changed from crashed to starting
2016-03-20T11:58:56.986655+00:00 heroku[web.1]: Starting process with command `apiweb`
2016-03-20T11:58:58.389926+00:00 app[web.1]: bash: apiweb: command not found
2016-03-20T11:58:59.060779+00:00 heroku[web.1]: State changed from starting to crashed
2016-03-20T11:58:59.049447+00:00 heroku[web.1]: Process exited with status 127

过程文件:

web: apiweb
worker: apiworker

项目结构:

.
├── Godeps
│   ├── Godeps.json
│   └── Readme
├── Procfile
├── cmd
│   ├── apiweb
│   │   └── main.go
│   └── apiworker
│   └── main.go
├── vendor
<snip>
└── api.go

令人惊讶的是,我在文档、此处和其他地方搜索答案时收效甚微。任何帮助将不胜感激!

最佳答案

有点晚了,但我昨天遇到了同样的问题,对我有用的是重新保存依赖项。

将主电源移至 cmd 后,您需要运行 $ godep save ./cmd/...,这当然会更新您的 Godeps.json 文件,但更重要的是它会添加/更新json 中的 "Packages" 字段,它又被 heroku 的 buildpack ( link ) 用来运行 $ go install$ godep go install(link)。

在我重新保存依赖项之前,Godeps.json 文件没有 "Packages" 字段,因此 buildpack 将仅在项目中运行 $ go install根文件夹,而不是在 cmd 文件夹中安装源,这将导致 command not found 错误。

关于英雄联盟。庆典 : apiworker: command not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36113794/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com