我已经为此奋斗了几个小时,但我不明白为什么在 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/