HEROKU:部署 symfony 4 应用推送失败

时间:2021-03-11 09:07:09

标签: heroku symfony4

josh@josh:~/my_projects/la_manne$ git push heroku master
Énumération des objets: 3, fait.
Décompte des objets: 100% (3/3), fait.
Écriture des objets: 100% (3/3), 230 octets | 230.00 Kio/s, fait.
Total 3 (delta 0), réutilisés 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote:  !     No default language could be detected for this app.
remote:             HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote:             See https://devcenter.heroku.com/articles/buildpacks
remote: 
remote:  !     Push failed
remote:  !
remote:  ! ## Warning - The same version of this code has already been built: 73ed9a909f2a7e80a0a45f0f5d86aa6c7fdd70c1
remote:  !
remote:  ! We have detected that you have triggered a build from source code with version 73ed9a909f2a7e80a0a45f0f5d86aa6c7fdd70c1
remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote:  !
remote:  ! If you are developing on a branch and deploying via git you must run:
remote:  !
remote:  !     git push heroku <branchname>:main
remote:  !
remote:  ! This article goes into details on the behavior:
remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to lamanne.
remote: 
To https://git.heroku.com/lamanne.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: impossible de pousser des références vers 'https://git.heroku.com/lamanne.git'

1 个答案:

答案 0 :(得分:0)

remote: -----> Building on the Heroku-20 stack
remote:  !     No default language could be detected for this app.
remote:             HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote:             See https://devcenter.heroku.com/articles/buildpacks

https://github.com/heroku/heroku-buildpack-php#usage

<块引用>

您至少需要使用一个空的 composer.json 申请。

$ echo '{}' > composer.json
$ git add composer.json
$ git commit -m "add composer.json for PHP app detection"

如果您还有来自其他框架或语言的文件可以 触发另一个 buildpack 将您的应用程序检测为其中一个 拥有,例如可能会导致您的代码被检测到的 package.json 作为一个 Node.js 应用程序,即使它是一个 PHP 应用程序,那么你 需要手动设置您的应用程序以使用此构建包:

$ heroku buildpacks:set heroku/php

这将使用正式发布的版本。使用默认值 改为从 GitHub 分支:

$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-php

有关进一步的使用说明,请参阅开发中心。