doulan1866 2017-11-17 22:28
浏览 42
已采纳

Heroku找不到Go应用程序

I'm having some trouble getting it detect the application binary.

For example, my project is called GoServer which is located in $GOPATH/src/GoServer and its binary (which was created by running go install in the project directory) is located in $GOPATH/bin/

Now if I try to run the instance locally using go run main.go it works just fine. If I run it locally using the Heroku Local toolkit (heroku local) it also works fine. BUT when it push to Heroku's remote repo and open the page from there, it crashes. In the logs it says that it could not find GoServer (bash: GoServer: command not found).

How can I fix this? Most of the similar issues threads I've seen refer to a misconfigured GOPATH but mine seems to be fine since Heroku Local works, but not the actual remote setup.

  • 写回答

1条回答 默认 最新

  • dsozqcx9668 2017-11-18 07:11
    关注

    The package in your glide.yaml is incorrect, change it to the package your code is in, that is GoServer. This is the package that gets installed by glide. Since this did not match the package (folder) of your code, GoServer did not get installed and was not available as an executable on heroku. It worked for you locally as you (or your IDE) compiled and installed GoServer and placed the executable into $GOPATH/bin, and so it could be run locally.

    So the first line in glide.yaml should be:

    package: GoServer
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作