Laravel Scout,Lumen 应用程序给出 [ErrorException] Illuminate\Support\Manager::createDriver() 缺少参数 1

Laravel Scout, Lumen application gives [ErrorException] Missing argument 1 for Illuminate\Support\Manager::createDriver()

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

[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 

当部署 运行s 播种器 class 用于关联的 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);

是的,我使用的是自定义 scout 引擎,它在我的机器上运行完美。

我已经知道是 laravel/scout 包导致了问题,因为当我从 eloquent class 中删除 Searchable 特征时问题,部署 运行 成功。

我想了解解决此问题的一些见解和方向。

谢谢

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

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

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 文件中,这就是它在我的机器上没有给我问题的原因。