CakeDC/migrations - "Error: Plugin Migrate could not be found"

CakeDC/migrations - "Error: Plugin Migrate could not be found"

我在加载迁移插件时遇到问题。

但是我在尝试 运行 迁移时仍然遇到此错误。

SPT@FI-JKL-D-18 /c/xampp/htdocs/Emailer/app (master)
$ /c/xampp/htdocs/Emailer/lib/Cake/Console/cake Migrations.migrate generate

Error: Plugin Migrate could not be found.
#0 C:\xampp\htdocs\Emailer\lib\Cake\Core\App.php(227): CakePlugin::path('Migrate')
#1 C:\xampp\htdocs\Emailer\lib\Cake\Core\App.php(549): App::path('Console/Command', 'Migrate')
#2 [internal function]: App::load('MigrateShell')
#3 [internal function]: spl_autoload_call('MigrateShell')
#4 C:\xampp\htdocs\Emailer\lib\Cake\Console\ShellDispatcher.php(257): class_exists('MigrateShell')
#5 C:\xampp\htdocs\Emailer\lib\Cake\Console\ShellDispatcher.php(203): ShellDispatcher->_getShell('Migrations.migr...')
#6 C:\xampp\htdocs\Emailer\lib\Cake\Console\ShellDispatcher.php(66): ShellDispatcher->dispatch()
#7 C:\xampp\htdocs\Emailer\lib\Cake\Console\cake.php(54): ShellDispatcher::run(Array)
#8 {main}

我相信你的语法有误。

而不是

cake Migrations.migrate generate

尝试运行

cake Migrations.migration generate

查看 examples in the CakeDC/migrations 插件。

我正在使用 CakePHP 4。我遇到了同样的问题。我已经解决了问题 运行 命令 cake migrations migrate。它对我有用。