当我尝试使用此部署脚本使用 Forge 进行部署时:
cd /home/forge/default
git pull origin master
cd /home/forge/default/server
composer install --no-interaction --no-dev --prefer-dist
php artisan migrate --force
它失败并抛出下面的错误。我在 composer.json 中使用这些依赖项,并且在 require 中没有开发依赖项。
作曲家.json
"require": {
"php": ">=5.5.9",
"laravel/framework": "5.1.*",
"nesbot/carbon": "~1.14",
"guzzlehttp/guzzle": "^6.0",
"tymon/jwt-auth": "0.5.*",
"barryvdh/laravel-cors": "^0.7.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1",
"barryvdh/laravel-debugbar": "~2.0"
},
错误
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'Barryvdh\Debugbar\ServiceProvider' not found
如何解决此问题,以便部署不会引入开发依赖项,但不必更改提供程序设置以进行开发?或者,我是否应该不费心设置 --no-dev 并拉入所有内容?当我放弃 --no-dev 标志时工作。