Composer update not fully installing Laravel application

When deploying my application through Laravel Forge, I get the following errors:

Fatal error: Class 'Illuminate\Support\Arr' not found in /home/forge/toono.co/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 151 

This is after running the composer update command. I have SSH'd in the directory, and low and lo, the Arr.php file Arr.php not exist.

The code is pulled from the main branch in BitBucket, and then the following lines are executed on the production server:

 cd /home/forge/default git pull origin master composer install php artisan migrate --force 

Composer.json:

 { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": [ "framework", "laravel" ], "license": "MIT", "require": { "laravel/framework": "4.2.*" }, "require-dev": { "way/generators": "2.*", "fzaninotto/faker": "1.4.*@dev", "barryvdh/laravel-debugbar": "1.*", "flynsarmy/csv-seeder": "1.0.*" }, "autoload": { "classmap": [ "app/commands", "app/controllers", "app/models", "app/database/migrations", "app/database/seeds", "app/tests/TestCase.php" ] }, "scripts": { "post-install-cmd": [ "php artisan clear-compiled", "php artisan optimize" ], "post-update-cmd": [ "php artisan clear-compiled", "php artisan debugbar:publish", "php artisan optimize" ], "post-create-project-cmd": [ "php artisan key:generate" ] }, "config": { "preferred-install": "dist" }, "minimum-stability": "stable" } 

Composer.lock:

 "require": { "codesleeve/stapler": "~1", "laravel/framework": "~4", "php": ">=5.4.0" } 

Why did composer update skip this file? After a local update, and even on the main branch in Github, is Arr.php ?

If I am missing the required code that you need, let me know.

Any help would be greatly appreciated.

+5
source share
2 answers

I solved this by deleting the composer.lock and vendor folder on the production server. Then I used composer update .

+3
source

I solved this by ssh'ing in the field via the command line (ssh forge@ip.of.server )

if you do not know how ssh is on the server, you go to the forge โ†’ server โ†’ SSH keys.

There you will add your public key (if you did not install the ssh keys, follow this guide: https://help.github.com/articles/generating-ssh-keys ).

If you have ssh keys installed, you simply open a terminal and insert the following command and run it; "pbcopy <~ / .ssh / id_rsa.pub", this will copy your public key into your clipboard, and you can simply paste it into the ssh key field in forge.

Now I can ssh on the server.

Then I went to the default folder (cd / home / forge / default) and performed a โ€œcomposer updateโ€

It updates everything and after that it works.

+1
source

Source: https://habr.com/ru/post/1201662/


All Articles