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

时间:2017-07-31 17:21:31

标签: php elasticsearch lumen codeship laravel-scout

使用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 

当部署为相关的雄辩模型运行播种器类时,就会出现这种情况。

我在本地计算机上没有收到此错误。在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特征时,问题就出现了,{I}部署成功运行。

我想在解决这个问题上有一些见解和方向。

由于

1 个答案:

答案 0 :(得分: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

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