Did you update the bootstrap/autoload.php as listed here? http://laravel.com/docs/5.1/upgrade#upgrade-5.1.0
Deployment broken when upgrading to Laravel 5.1
Hi there,
I've upgraded my app from Laravel version 5.0 to 5.1. Locally, all my unit tests have passed so I deployed to Heroku and all is seemingly well until I hit a page where one of the methods from Carbon is called.
Here's the error from the logs:
PHP Fatal error: Carbon\Carbon::setLocale(): Failed opening required '/tmp/build_dd40f31f287e50a947b28cc04088e5dc/vendor/nesbot/carbon/src/Carbon/Lang/en.php' (include_path='.:/app/.heroku/php/lib/php') in /app/bootstrap/cache/compiled.php on line 17053
I've tried running composer update, php artisan clear-compiled and php artisan optimize but still getting the same error.
Could anyone help?
Ok, heard back from Heroku support on this and they have created an issue on the Laravel repo.
Basically __DIR__ and __FILE__ differ when building and at runtime, so this is why it's trying to autoload a file which doesn't exist.
Quick fix is to remove php artisan optimize from the post-install-cmd and post-update-cmd blocks in composer.json.
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan clear-compiled"
],
Then run heroku run composer update.
Hope this helps!
Please or to participate in this conversation.