本地我没有收到错误,但是当我部署到我的服务器(使用Git)时,我收到以下错误:
production.ERROR: exception 'ReflectionException' with message 'Class cors does not exist' in /home/ruben/apps/bootstrap/cache/compiled.php:1244
Stack trace:
#0 /home/ruben/apps/bootstrap/cache/compiled.php(1244): ReflectionClass->__construct('cors')
#1 /home/ruben/apps/bootstrap/cache/compiled.php(1195): Illuminate\Container\Container->build('cors', Array)
#2 /home/ruben/apps/bootstrap/cache/compiled.php(1733): Illuminate\Container\Container->make('cors', Array)
#3 /home/ruben/apps/bootstrap/cache/compiled.php(9459): Illuminate\Foundation\Application->make('cors')
#4 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#5 /home/ruben/apps/bootstrap/cache/compiled.php(9449): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#6 /home/ruben/apps/bootstrap/cache/compiled.php(7375): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#7 /home/ruben/apps/bootstrap/cache/compiled.php(7363): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#8 /home/ruben/apps/bootstrap/cache/compiled.php(7348): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#9 /home/ruben/apps/bootstrap/cache/compiled.php(2262): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#10 [internal function]: Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#11 /home/ruben/apps/bootstrap/cache/compiled.php(9467): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#12 /home/ruben/apps/bootstrap/cache/compiled.php(2882): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#13 [internal function]: Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#14 /home/ruben/apps/bootstrap/cache/compiled.php(9459): call_user_func_array(Array, Array)
#15 /home/ruben/apps/bootstrap/cache/compiled.php(12755): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#16 [internal function]: Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#17 /home/ruben/apps/bootstrap/cache/compiled.php(9459): call_user_func_array(Array, Array)
#18 /home/ruben/apps/bootstrap/cache/compiled.php(11390): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#19 [internal function]: Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#20 /home/ruben/apps/bootstrap/cache/compiled.php(9459): call_user_func_array(Array, Array)
#21 /home/ruben/apps/bootstrap/cache/compiled.php(12496): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#22 [internal function]: Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 /home/ruben/apps/bootstrap/cache/compiled.php(9459): call_user_func_array(Array, Array)
#24 /home/ruben/apps/bootstrap/cache/compiled.php(12435): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#25 [internal function]: Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /home/ruben/apps/bootstrap/cache/compiled.php(9459): call_user_func_array(Array, Array)
#27 /home/ruben/apps/bootstrap/cache/compiled.php(2932): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#28 [internal function]: Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /home/ruben/apps/bootstrap/cache/compiled.php(9459): call_user_func_array(Array, Array)
#30 [internal function]: Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#31 /home/ruben/apps/bootstrap/cache/compiled.php(9449): call_user_func(Object(Closure), Object(Illuminate\Http\Request))
#32 /home/ruben/apps/bootstrap/cache/compiled.php(2209): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#33 /home/ruben/apps/bootstrap/cache/compiled.php(2192): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#34 /home/ruben/apps/public/index.php(54): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#35 {main}
我已删除了我的/ vendor文件夹和composer.lock文件,并再次运行composer install。我查了一下,班上的文件都在那里......
我希望有人可以帮助我。
更新 我得到一些关于区分大小写的提示。我真的不知道如何使用这个技巧,因为我刚刚使用composer.json来安装软件包。我决定将cors注释掉,然后弹出下一个错误:
production.ERROR: exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Class 'JWTAuth' not found' in
这是一个类似的错误,我和Cors类在同一时间添加了一个类。我无法弄清楚为什么课程没有加载。
答案 0 :(得分:0)
对不起,我迟到了,我刚刚解决了。你的项目根本运行了:
composer dump-autoload