【问题标题】:"bash: play: command not found" when trying heroku for the first time第一次尝试 heroku 时出现“bash: play: command not found”
【发布时间】:2013-01-25 16:00:48
【问题描述】:

我正在试用 Play!与 heroku 一起阅读 heroku 网站 (https://devcenter.heroku.com/articles/play) 中的指南。部署我的示例应用程序后,我注意到测功机崩溃了。我查看了heroku的日志,发现heroku找不到播放命令。

任何人都知道如何安装 Play! heroku 上的框架?我搜索了开发中心,但找不到任何信息。

【问题讨论】:

标签: heroku playframework-2.0


【解决方案1】:

我遇到了同样的问题,修复方法是将 Procfile 更改为使用命令 target/start 而不是 play,然后将其推送到 Heroku。请参阅下面的差异。

【讨论】:

  • 如果你运行 play 2.2+ 你需要: "web: target/universal/stage/bin/{your project name} -Dhttp.port=$PORT"
  • @adib $PLAY_OPTS 和 $JAVA_OPTS 之间的区别是什么。这些是从哪里捡来的?
  • @john Heroku 的运行时环境。
【解决方案2】:

Heroku 会自动检测 Play!应用程序并安装 Play!将代码推送到 Heroku 时为您提供运行时。如果玩!没有被安装,很可能你的应用程序没有被正确检测为 Play!应用程序。

在播放的情况下! 1.2.x(如您正在阅读的开发中心文章中),将执行检测的Play! buildpack,在 Play 2.x 的情况下,Scala buildpack 用于检测和安装 Play!给你的框架。有关Heroku Play Framework Support 的更多信息以及检测所需的内容,请参阅: https://devcenter.heroku.com/articles/play-support

如果您的应用仍然无法被检测到,我建议您克隆并推送https://github.com/heroku/devcenter-play.git,这是您正在阅读的开发中心文章中的完整示例应用:

git clone https://github.com/heroku/devcenter-play.git
cd devcenter-play
heroku create
git push heroku master
heroku open

【讨论】:

    【解决方案3】:

    接受的答案是正确的,但是如果您想定义自己的 Procfile,则需要按照 aib 提供的说明进行操作。目前在 Heroku 网站上列出的示例 Procfile 专门用于播放 1.x 应用程序。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-22
      • 2020-09-16
      • 2016-01-06
      • 2019-07-07
      • 1970-01-01
      • 1970-01-01
      • 2017-04-08
      • 2014-08-10
      相关资源
      最近更新 更多