0

使用 Codeship 部署流明应用程序时出现错误

[ErrorException]                                                             
  Missing argument 1 for Illuminate\Support\Manager::createDriver(), called i  
  n /home/rof/src/bitbucket.org/rakkle/rakkleapi/vendor/illuminate/support/Ma  
  nager.php on line 88 and defined 

它在部署运行相关的 eloquent 模型的播种器类时出现。

我在本地机器上没有收到此错误。在bootstrap/app.php我添加的

$app->instance('path.config', app()->basePath() . DIRECTORY_SEPARATOR . 'config');
$app->configure('scout');

$app->register(Laravel\Scout\ScoutServiceProvider::class);
$app->register(ScoutEngines\Elasticsearch\ElasticsearchProvider::class);

是的,我正在使用定制的侦察引擎,它在我的机器上运行完美。

我已经到了一个地步,我知道是laravel/scout包给出了问题,因为当我Searchable从给出问题的 eloquent 类中删除特征时,部署成功运行。

我想在解决这个问题时获得一些见解和方向。

谢谢

4

1 回答 1

0

我找到了解决这个问题的方法。

这是我在机器上复制的完整错误

ErrorException: Missing argument 1 for Illuminate\Support\Manager::createDriver(), called in /var/www/vendor/illuminate/support/Manager.php on line 88 and defined

    /var/www/vendor/illuminate/support/Manager.php:77
    /var/www/vendor/illuminate/support/Manager.php:88
    /var/www/vendor/illuminate/support/Manager.php:63
    /var/www/vendor/laravel/scout/src/EngineManager.php:21
    /var/www/vendor/laravel/scout/src/Searchable.php:203
    /var/www/vendor/laravel/scout/src/Searchable.php:56
    /var/www/vendor/laravel/scout/src/Searchable.php:35
    /var/www/vendor/illuminate/support/Traits/Macroable.php:78
    /var/www/vendor/laravel/scout/src/Searchable.php:112
    /var/www/vendor/laravel/scout/src/ModelObserver.php:61
    /var/www/vendor/illuminate/events/Dispatcher.php:367
    /var/www/vendor/illuminate/events/Dispatcher.php:199
    /var/www/vendor/illuminate/events/Dispatcher.php:172
    /var/www/vendor/illuminate/database/Eloquent/Concerns/HasEvents.php:148
    /var/www/vendor/illuminate/database/Eloquent/Model.php:670
    /var/www/vendor/illuminate/database/Eloquent/Model.php:518
    /var/www/vendor/illuminate/database/Eloquent/Builder.php:734
    /var/www/vendor/illuminate/support/helpers.php:936
    /var/www/vendor/illuminate/database/Eloquent/Builder.php:735
    /var/www/vendor/illuminate/database/Eloquent/Model.php:1357
    /var/www/vendor/illuminate/database/Eloquent/Model.php:1369
    /var/www/tests/PetListingTest.php:150
    /var/www/tests/PetListingTest.php:93

我忘记添加的是 codeship 中的环境变量,这是SCOUT_DRIVER我用于搜索的。我在.env文件中有它,为什么它没有给我机器上的问题。

于 2017-08-06T17:36:27.933 回答