【问题标题】:Can't deploy Play 2.2.2 application to Heroku无法将 Play 2.2.2 应用程序部署到 Heroku
【发布时间】:2014-05-02 11:57:15
【问题描述】:

尝试将 Play 2.2.2 应用程序部署到 Heroku 时出现以下错误。

    158-37-227-60:Bachelorprosjekt Magne$ heroku create --buildpack https://github.com/heroku/heroku-buildpack-scala.git
Creating murmuring-scrubland-2494... done, stack is cedar
BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-scala.git
http://murmuring-scrubland-2494.herokuapp.com/ | git@heroku.com:murmuring-scrubland-2494.git
158-37-227-60:Bachelorprosjekt Magne$ git push heroku master
fatal: 'heroku' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
158-37-227-60:Bachelorprosjekt Magne$ git remote add heroku git@heroku.com:murmuring-scrubland-2494.git
158-37-227-60:Bachelorprosjekt Magne$ git push heroku master
Initializing repository, done.
Counting objects: 627, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (254/254), done.
Writing objects: 100% (627/627), 290.28 KiB | 166.00 KiB/s, done.
Total 627 (delta 312), reused 573 (delta 286)

-----> Fetching custom git buildpack... done

 !     Push rejected, no Cedar-supported app detected

To git@heroku.com:murmuring-scrubland-2494.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:murmuring-scrubland-2494.git'

我的 Procfile 看起来像这样:

web: target/universal/stage/bin/Bachelorprosjekt -Dhttp.port=$PORT

我一直在到处寻找解决方案,但到目前为止,类似问题的解决方案对我没有帮助:S

更新:当我尝试在不指定构建包的情况下进行部署时,Heroku 会尝试将其部署为 Play 1.2.7 应用程序,而不是真正的 Play 2.2.2 应用程序。显然每次部署都会失败。这是我得到的输出:

-----> Play! app detected
-----> Installing OpenJDK 1.6...done
-----> WARNING: Play! version not specified in dependencies.yml. Default version: 1.2.7 being used....
-----> Installing Play! 1.2.7.....
-----> done
-----> Installing ivysettings.xml..... done
-----> Building Play! application...
       ~        _            _ 
       ~  _ __ | | __ _ _  _| |
       ~ | '_ \| |/ _' | || |_|
       ~ |  __/|_|\____|\__ (_)
       ~ |_|            |__/   
       ~
       ~ play! 1.2.7, http://www.playframework.org
       ~
       1.2.7
       Building Play! application at directory ./
       Resolving dependencies: .play/play dependencies ./ --forProd --forceCopy --silent -Duser.home=/tmp/build_addb406e-ac10-446c-bec7-3e6c14ad98e8 2>&1
       ~ !! /tmp/build_addb406e-ac10-446c-bec7-3e6c14ad98e8/conf/dependencies.yml does not exist
 !     Failed to build Play! application
 !     Cleared Play! framework from cache

 !     Push rejected, failed to compile Play! app

To git@heroku.com:praksisreg.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:praksisreg.git'

【问题讨论】:

  • 它可以在没有构建包的情况下工作......先“玩新”然后 git push。
  • 我添加构建包的原因是因为 Heroku 一直试图将其部署为 Play 1.2.7 应用程序,而它实际上是一个 Play 2.2.2 应用程序。我试图强制将其部署为 2.2.2。

标签: heroku playframework playframework-2.2


【解决方案1】:

作为 heroku 本身的stated,子文件夹中不可能有项目。

但是您可以使用 git subtree 参数将子文件夹推送到 herokus 根目录。

git subtree push --prefix subfoldername heroku master

有关更多信息,请参阅此Link

【讨论】:

    【解决方案2】:

    解决了。 Heroku 无法使用当前项目结构部署我的项目时出现问题。我的项目位于另一个文件夹中,并且必须位于根级别,Heroku 才能成功部署应用程序。

    【讨论】:

    • 是的,这是我最不最喜欢的 Heroku 功能之一。
    猜你喜欢
    • 1970-01-01
    • 2015-10-25
    • 2015-11-13
    • 2012-10-30
    • 2017-07-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多