CakePHP 3 Error: The application is trying to load a file from the DebugKit plugin

CakePHP 3 Error: The application is trying to load a file from the DebugKit plugin

我的 CakePHP 3 应用程序在我的本地服务器上运行良好。但是当我在 Heroku 上安装它时,我不断收到以下错误:

Error: The application is trying to load a file from the DebugKit plugin. Make sure your plugin DebugKit is in the /app/plugins/ directory and was loaded.

我很困惑,因为我已经做了 composer install,我在 vendor/cakephp/debug_kit 中看到了 debug_kit,但错误似乎是在其他插件目录中查找。

为什么会这样?

更新:我 运行 composer install --verbose 并且我看到以下错误:

$ composer install --verbose Loading composer repositories with package information Installing dependencies (including require-dev) from lock file Analyzed 91 packages to resolve dependencies Analyzed 165 rules to resolve dependencies Nothing to install or update Generating autoload files

post-autoload-dump: Cake\Composer\Installer\PluginInstaller::postAutoloadDump post-install-cmd: App\Console\Installer::postInstall

Script App\Console\Installer::postInstall handling the post-install-cmd event terminated with an exception



  [InvalidArgumentException]                            
  Maximum number of attempts must be a positive value.  



Exception trace:
 () at phar:///app/.heroku/php/bin/composer/vendor/symfony/console/Symfony/Component/Console/Question/Question.php:191
 Symfony\Component\Console\Question\Question->setMaxAttempts() at phar:///app/.heroku/php/bin/composer/src/Composer/IO/ConsoleIO.php:246
 Composer\IO\ConsoleIO->askAndValidate() at /app/src/Console/Installer.php:55
 App\Console\Installer::postInstall() at phar:///app/.heroku/php/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:211
 Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar:///app/.heroku/php/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:167
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///app/.heroku/php/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:92
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///app/.heroku/php/bin/composer/src/Composer/Installer.php:342
 Composer\Installer->run() at phar:///app/.heroku/php/bin/composer/src/Composer/Command/InstallCommand.php:131
 Composer\Command\InstallCommand->execute() at phar:///app/.heroku/php/bin/composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
 Symfony\Component\Console\Command\Command->run() at phar:///app/.heroku/php/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:874
 Symfony\Component\Console\Application->doRunCommand() at phar:///app/.heroku/php/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:195
 Symfony\Component\Console\Application->doRun() at phar:///app/.heroku/php/bin/composer/src/Composer/Console/Application.php:146
 Composer\Console\Application->doRun() at phar:///app/.heroku/php/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at phar:///app/.heroku/php/bin/composer/src/Composer/Console/Application.php:82
 Composer\Console\Application->run() at phar:///app/.heroku/php/bin/composer/bin/composer:43
 require() at /app/.heroku/php/bin/composer:25


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]

错误似乎来自 Symfony

我 运行 进入过一次,相信我通过用更新的版本替换 App\Console\Installer 来修复它。

这个修复它的提交可以追溯到这个问题:https://github.com/cakephp/app/issues/241

(您可以借此机会升级应用中来自模板的其他文件。)