Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Patchwork\Utf8\Bootup causing problems with Laravel 4

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?

like image 288
jamespick Avatar asked Jan 16 '14 00:01

jamespick


3 Answers

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.

like image 137
Mohamed Azher Avatar answered Nov 07 '22 20:11

Mohamed Azher


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.

like image 30
Dominic Tancredi Avatar answered Nov 07 '22 22:11

Dominic Tancredi


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.

like image 39
Monica Avatar answered Nov 07 '22 22:11

Monica