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 plotBAPC画图出错
  • ¥30 关于#opencv#的问题:使用大疆无人机拍摄水稻田间图像,拼接成tif图片,用什么方法可以识别并框选出水稻作物行
  • ¥15 Python卡尔曼滤波融合
  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理