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条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度