Cake\Routing\Router not found in shell after migration to cakephp-4

519 views Asked by At

After updating my app from 3.9 to 4.1.4 shell scripts stopped working. Typing this bin/cake plugin assets symlink yields this error message:

PHP Fatal error:  Uncaught Error: Class 'Cake\Routing\Router' not found in /var/www/releases/12/vendor/cakephp/cakephp/config/bootstrap.php:27
Stack trace:
#0 /var/www/releases/12/config/bootstrap.php(32): require()
#1 /var/www/releases/12/bin/cake.php(31): include('/var/www/...')
#2 {main}
thrown in /var/www/releases/12/vendor/cakephp/cakephp/config/bootstrap.php on line 27

I assume there is something wrong with autoloading, but I don`t know where to start with this.

1

There are 1 answers

0
David Albrecht On BEST ANSWER

It turns out I did not replace the contents of the bin folder. They have changed with the new major version of cakephp and must be replaced with the files from the app-skeleton: https://github.com/cakephp/app/tree/master/bin