Patchwork\Utf8\Bootup causing problems with Laravel 4

自古美人都是妖i 提交于 2019-12-30 09:00:14

问题


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?


回答1:


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.




回答2:


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.




回答3:


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.




回答4:


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



来源:https://stackoverflow.com/questions/21151402/patchwork-utf8-bootup-causing-problems-with-laravel-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!