duandunzhuo3234 2014-12-09 21:34
浏览 129
已采纳

在Heroku上运行Go应用

I'm trying to follow the tutorial at https://mmcgrana.github.io/2012/09/getting-started-with-go-on-heroku. Initially everything seems to work:

ceiroa-ltm:my_heroku_app ceiroa$ heroku create -b https://github.com/kr/heroku-buildpack-go.git
Creating glacial-badlands-6720... done, stack is cedar-14
BUILDPACK_URL=https://github.com/kr/heroku-buildpack-go.git
https://glacial-badlands-6720.herokuapp.com/ | https://git.heroku.com/glacial-badlands-6720.git
Git remote heroku added
ceiroa-ltm:my_heroku_app ceiroa$ git push heroku master
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (10/10), 925 bytes | 0 bytes/s, done.
Total 10 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Fetching custom git buildpack... done
remote: -----> Go app detected
remote: -----> Installing go1.3.3... done
remote: -----> Running: godep go install -tags heroku ./...
remote: -----> Discovering process types
remote: 
remote: -----> Compressing... done, 1.5MB
remote: -----> Launching... done, v4
remote:        https://glacial-badlands-6720.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy... done.
To https://git.heroku.com/glacial-badlands-6720.git
 * [new branch]      master -> master

However, no dynos are spinned:

ceiroa-ltm:my_heroku_app ceiroa$ heroku ps
ceiroa-ltm:my_heroku_app ceiroa$ 

And the app gives an error:

enter image description here

What am I doing wrong?

  • 写回答

2条回答 默认 最新

  • dongyirong3564 2014-12-09 23:46
    关注

    I tried a bunch of things that didn't work:

    1. downgrade go version (to match the one defined in https://github.com/kr/go-heroku-example/blob/master/Godeps/Godeps.json)
    2. move from default Eclipse Go structure to one without src, bin, or pkg inside project
    3. use hyphens instead of underscores (for project name and in Procfile and Godeps.json)
    4. define full identifier in Godeps.json

    At the end and started from scratch again, creating the project from the command line instead of from Eclipse, and this worked.

    From the things above, I can rule out #1 and #4 as fixes, as I'm back to using the same config I initially had.

    Another thing that was throwing me off was references to ".godir" in different websites and posts. I don't know what this file used to be used for, but it doesn't seem necessary any more.

    I'm going to point to Eclipse and its Go plugin as the culprits, for now.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?