使用Composer安装时,Laravel Forge部署脚本在Debugbar Provider上失败--no-dev

时间:2015-07-29 05:30:56

标签: laravel laravel-5 laravel-5.1 laravel-forge

当我尝试使用此部署脚本使用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中没有dev依赖项。

Composer.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 flag。

1 个答案:

答案 0 :(得分:1)

我自己也使用DebugBar,只需用作曲家拉入所有内容。我只在我的开发机器上显示调试栏:

*a

Source