我创建了一个新的 Symfony 项目,并且不断收到此消息“DoctrineMigrationsBundle 需要启用 DoctrineBundle”。错误并且无法摆脱它。显然我是这个星球上唯一遇到此错误的人,因为谷歌并没有太大帮助。
在 config/bundles.php 文件中,我有以下内容应该“启用”DoctrineBundle,但我丢失了一些东西并且无法告诉它是什么。
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
];
我也有同样的错误, 由于某种原因,应该在
config/packages
内的 yaml 文件没有提交到 git。
您可以执行以下操作:
/bin
文件夹,请复制它 !/bin/
!/config/packages/*
(将
!/bin
添加到 .gitignore
与此错误无关,但从 symfony 6 开始不应再忽略它,并且是修复此其他错误的解决方案:Script cache:clear returned with error code 1
Could not open input file: ./bin/console).
当您从 git 安装 symfony 项目时。