“bash: play: command not found” when trying heroku for the first time

孤街醉人 提交于 2020-01-03 17:44:59

问题


I'm trying out Play! with heroku and was going through the guide in the heroku site (https://devcenter.heroku.com/articles/play). After deploying my sample app, I noticed the dyno crashed. I checked the heroku logs and found out that heroku couldn't find the play command.

Anyone know how to install the Play! framework on heroku? I searched the dev center but couldn't find any info.


回答1:


Heroku will automatically detect Play! applications and install the Play! runtime for you when you push your code to Heroku. If Play! isn't being installed, its likely that your app is not being detected properly as a Play! app.

In the case of Play! 1.2.x (as in the Dev Center article you were reading), the Play! buildpack that will do the detection, and in the case of Play 2.x, the Scala buildpack is used to detect and install the Play! framework for you. For more information about Heroku Play Framework Support and what is needed for detection, see: https://devcenter.heroku.com/articles/play-support

If you are still having problems with your app getting detected, I'd recommend cloning and pushing https://github.com/heroku/devcenter-play.git, which is the complete sample app from the Dev Center article you were reading:

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



回答2:


I had the same issue and the fix was changing the Procfile to use the command target/start instead of play and then pushing it to Heroku. Refer to the diff below.




回答3:


The accepted answer is correct, but if you want to define your own Procfile you'll need to follow the instructions that adib provided. The sample Procfile that's currently listed on Heroku's site is specific to play 1.x apps.



来源:https://stackoverflow.com/questions/14797106/bash-play-command-not-found-when-trying-heroku-for-the-first-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!