Scala Play 2.2 应用程序在 Heroku 中部署后崩溃 : target/start No such file or directory

标签 scala heroku deployment scala-2.10 playframework-2.2

我已经为此奋斗了几个小时,但我不明白为什么在 Heroku 中部署我的 Scala Play 2.2 应用程序后我得到了这个堆栈跟踪:

2013-09-30T01:05:09.413177+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=18174 $PLAY_OPTS`
2013-09-30T01:05:10.931893+00:00 app[web.1]: bash: target/start: No such file or directory
2013-09-30T01:05:12.382399+00:00 heroku[web.1]: Process exited with status 127
2013-09-30T01:05:12.414050+00:00 heroku[web.1]: State changed from starting to crashed

我尝试了几个 Procfile 版本,但没有成功,一些例子是:

web: target/start -Dhttp.port=$PORT

web: target/start -Dhttp.port=$PORT $PLAY_OPTS

web: target/start -Dhttp.port=$PORT $JAVA_OPTS

web: target/start Web -Dhttp.port=$PORT $PLAY_OPTS

web: target/start -Dhttp.port=$PORT $PLAY_OPTS -Dconfig.file=application.conf

web: target/start -Dhttp.port=$PORT $PLAY_OPTS -Dconfig.file=conf/application.conf

我什至尝试过不使用 Procfile。

我正在使用 Scala 2.10.2 和 Play 2.2。在同一个 Heroku 应用程序中,我的项目的早期版本在 Play 2.0 上运行,我不知道这是否相关。

该应用程序在本地运行完美。我连接到 Heroku 中的 bash 并运行

sbt clean
sbt stage

我手动检查了目标是否已清理并再次构建。

“目标/开始:没有这样的文件或目录”指的是什么?到目标?到启动命令?为了别的事?

最佳答案

Play 2.2 更改了用于启动应用的文件的名称和位置

http://www.playframework.com/documentation/2.2.x/Production

例如,要从项目文件夹启动项目“foo”的应用程序,请更新您的 Procfile 以运行:

target/universal/stage/bin/foo

关于Scala Play 2.2 应用程序在 Heroku 中部署后崩溃 : target/start No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19085213/

相关文章:

Scala 列表操作

scala - 可以为 CI 构建关闭 sbt 中的增量编译器吗?

java - Scala:需要 "explicit return"吗?

ruby-on-rails - 使用 SQLite 在本地运行,但在 Heroku : PGError: ERROR: syntax error at or near "NULL" 上运行

java - Heroku 和 Mule

deployment - 管理运行 Camel 路由的节点的部署

perl - 自动从 CPAN 安装缺失的模块

scala - 如何处理对 Scala 集合的并发访问?

rake - 将 Gollum wiki 部署到 Heroku

heroku - 了解 Heroku 服务器状态 143