Here is the error I am getting:
Script php artisan optimize handling the post-update-cmd event returned with an error
[RuntimeException]
Error Output:
up
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.