我目前正在尝试将Sentry添加到我的Laravel项目中,但我在做composer require sentry/sentry-laravel时遇到了这个问题。
我遇到的错误是:
@php artisan package:discover --ansi
Error
Class 'Sentry\ClientBuilder' not found
at vendor/sentry/sentry-laravel/src/Sentry/Laravel/ServiceProvider.php:122
118| ],
119| $userConfig
120| );
121|
> 122| $clientBuilder = ClientBuilder::create($options);
123|
124| // Set the Laravel SDK identifier and version
125| $clientBuilder->setSdkIdentifier(Version::SDK_IDENTIFIER);
126| $clientBuilder->setSdkVersion(Version::SDK_VERSION);
• Database name seems incorrect: You're using the default database name `homestead`. This database does not exist.
Edit the `.env` file and use the correct database name in the `DB_DATABASE` key.
https://laravel.com/docs/master/database#configuration我的.env文件
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secretLaravel版本: 7.5.2
我通过Homestead运行所有东西,我的数据库确实存在,项目正在运行,但我找不出为什么会出现这个错误。
提前感谢您的帮助!
发布于 2020-04-14 01:20:20
使用此composer require sentry/sentry-laravel:1.7.0
由于您使用的是Laravel 7,包将在您的
配置/app.php.
发布于 2020-04-17 03:53:47
@NinetyHH这真的很奇怪,我认为数据库中的“提示”是无关的,它试图变得聪明,但未能给出令人困惑的消息:)
您是否可以手动将"sentry/sentry-laravel": "^1.7"添加到您的composer.json中,并运行composer update来查看这是否解决了问题,在我看来,依赖项似乎没有正确安装。
如果这还不能解决它,你能:
https://stackoverflow.com/questions/61192899
复制相似问题