首页 > 解决方案 > 解析 heroku.yml 的问题 - build.web 是一个被禁止的属性

问题描述

当我推送时,heroku master我收到以下错误:

=!= There were problems parsing your heroku.yml. We've detected the following issues:
remote:
remote: "build" must validate one and only one schema (oneOf). Found none valid
remote:
remote: build.web in body is a forbidden property
remote:
remote: build.docker in body is a forbidden property
remote: Verifying deploy...
remote:
remote: !       Push rejected to radiant-crag-94686.
remote:
To https://git.heroku.com/radiant-crag-94686.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/radiant-crag-94686.git'

heroku.yml的就是这个,看起来像在 Heroku 开发中心:

setup:
  addons:
  - plan: heroku-postgresql
build:
  docker:
    web: Dockerfile
release:
  image: web
  command:
    - python manage.py collectstatic --noinput
run:
  web: gunicorn bookstore_project.wsgi

我尝试删除应用程序并创建一个新应用程序,仍然是同样的错误。

标签: gitdockerheroku

解决方案


您可以仔细检查heroku.yml文件上的缩进吗?我遇到了错误.web in body is a forbidden property并通过缩进下面的 web 属性来修复它run。我会为 docker 属性检查相同的内容。我不确定其他错误。


推荐阅读