尝试升级到 laravel 5.3,但我一直看到错误“调用未定义的方法 Illuminate

我正在尝试从 5.2 升级 laravel 5.3,但我不断在日志文件中看到这两个错误:


Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Error: Call to undefined method Illuminate\Auth\Access\Gate::abilities() in /Users/rohan0793/Code/poptin_v3/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:237


和这个:


Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Log\Writer::setHandlers() in Command line code:1


全栈输出:


[2020-08-13 08:26:58] local.ERROR: Symfony\Component\Debug\Exception\FatalErrorException: Uncaught Error: Call to undefined method Illuminate\Auth\Access\Gate::abilities() in /Users/rohan0793/Code/poptin_v3/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:237

Stack trace:

#0 Command line code(1): Illuminate\Support\Facades\Facade::__callStatic('abilities', Array)

#1 {main}

  thrown in /Users/rohan0793/Code/poptin_v3/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:237

[2020-08-13 08:26:58] local.ERROR: Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Log\Writer::setHandlers() in Command line code:1

Stack trace:

我不知道这些来自哪里以及如何解决它们。


更新:我每分钟 41 秒都会看到这些错误。示例13:35:41 但是根据我在 homestead 的 crontab,我没有安排任何 crons


更新 2: https: //github.com/Illuminate/auth/blob/5.5/Access/Gate.php 5.5 中提供了能力方法。但我还是5.3。很奇怪,但我不知道是什么在调用该代码。也许是第三方包。


30秒到达战场
浏览 69回答 2
2回答

qq_花开花谢_0

https://marketplace.visualstudio.com/items?itemName=amiralizadeh9480.laravel-extra-intellisense这个 VS Code 扩展导致了 2 个错误,它试图每分钟编译一些东西,因此非常混乱,感觉就像一个在后台运行的 cron 作业。

扬帆大鱼

尝试在官方文档中查找升级指南。它们涵盖了很多问题,也许您会找到自己的问题。这是一个非常具体的问题,您在代码中遗漏了某些内容,但从问题来看,我们无法知道。https://laravel.com/docs/5.3/upgrade#upgrade-5.3.0也尝试Rector升级或升级后出现任何问题https://github.com/rectorphp/rector
打开App,查看更多内容
随时随地看视频慕课网APP