Patchwork\Utf8\Bootup causing problems with Larave

2019-02-17 12:19发布

My project has been working fine until recently, when I ran sudo composer self-update. Composer successfully updated but I could no longer migrate (php artisan migrate). This is the error I get:

PHP Fatal error:  Class 'Patchwork\Utf8\Bootup' not found in /Applications/MAMP/htdocs/ThumbsUp/bootstrap/autoload.php on line 46

I have ran composer update and composer install, and still this error persists. Why would it not be finding this class after the self-update?

4条回答
SAY GOODBYE
2楼-- · 2019-02-17 12:50

In tracking down this issue, I found it had to do with this in my composer.json:

"pre-update-cmd": [ "php artisan clear-compiled" ],

My theory is that "clear-compiled" can't work because composer hasn't been updated. Deleting this, and then calling composer update and then re-adding it fixed my issue.

查看更多
Viruses.
3楼-- · 2019-02-17 12:53

I just removed composer.lock file and then run composer update And it worked.

查看更多
等我变得足够好
4楼-- · 2019-02-17 13:00

I had a similar issue when trying to run composer update and none of the solutions above had worked. It turns out I had 2 require sections in my composer.json which is actually wrong.

"require": {
    "laravel/framework": "4.1.*"
},
"config": {
    "preferred-install": "dist"
},
"minimum-stability": "stable",
"require": {
    "barryvdh/laravel-ide-helper": "1.*",
    "zizaco/confide": "3.2.x",
    "laravelbook/ardent": "dev-master",
    "zizaco/entrust": "dev-master"
},
"require-dev": {
    "way/generators": "2.*",
    "fzaninotto/faker": "1.3.*@dev"
}

Combining the two as below solved my issue.

"require": {
    "laravel/framework": "4.1.*",
    "barryvdh/laravel-ide-helper": "1.*",
    "zizaco/confide": "3.2.x",
    "laravelbook/ardent": "dev-master",
    "zizaco/entrust": "dev-master"
},

If you still have a problem, try deleting the composer.lock and the vendor directory and run

mv ~/.composer/cache ~/.composer/cache.bak

To clear the composer cache and finally run

sudo composer install

This should solve the issue.

查看更多
男人必须洒脱
5楼-- · 2019-02-17 13:05

I had the same problem, I ran composer dump-autoload or php composer.phar dump-autoload depending on your configuration, ran composer update again and it worked.

查看更多
登录 后发表回答