我正在和Homestead一起开展Laravel 5.1项目.我进入我的Vagrant机器并运行Composer Update命令试图更新我的项目,现在我收到以下错误:
1. in Container.php line 741 2. at ReflectionClass->__construct('view') in Container.php line 741 3. at Container->build('view', array()) in Container.php line 631 4. at Container->make('view', array()) in Application.php line 674 5. at Application->make('Illuminate\Contracts\View\Factory') in Container.php line 842 6. at Container->resolveClass(object(ReflectionParameter)) in Container.php line 805 7. at Container->getDependencies(array(object(ReflectionParameter)), array()) in Container.php line 776 8. at Container->build('Illuminate\View\Middleware\ShareErrorsFromSession', array()) in Container.php line 631 9. at Container->make('Illuminate\View\Middleware\ShareErrorsFromSession', array()) in /home/vagrant/Sites/laravel-basics/vendor/laravel/framework/src/Illuminate/Foundation/Application.php line 674 10. at Application->make('Illuminate\View\Middleware\ShareErrorsFromSession') in Pipeline.php line 123 11. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in StartSession.php line 62 12. at StartSession->handle(object(Request), object(Closure)) 13. at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 14. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in AddQueuedCookiesToResponse.php line 37 15. at AddQueuedCookiesToResponse->handle(object(Request), object(Closure)) 16. at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 17. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in EncryptCookies.php line 59 18. at EncryptCookies->handle(object(Request), object(Closure)) 19. at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 20. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in CheckForMaintenanceMode.php line 44 21. at CheckForMaintenanceMode->handle(object(Request), object(Closure)) 22. at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in Pipeline.php line 124 23. at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) 24. at call_user_func(object(Closure), object(Request)) in Pipeline.php line 103 25. at Pipeline->then(object(Closure)) in Kernel.php line 122 26. at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87 27. at Kernel->handle(object(Request)) in index.php line 54
我不确定是什么破了.我已经在Laravel 5.1工作,而Composer运行得很好.我觉得我有两个基本选项:1)尝试恢复以前版本的Composer或2)恢复到我项目的先前版本.但是,有一个更简单的解决方案吗?
我现在两次遇到此错误消息,所以我将解决方案放在这里以防万一我将来需要谷歌一段时间.
有时会发生此错误,因为"/ bootstrap/cache"目录不可写.因此,它无法编译视图.解决方案是chmod该目录,以便可以写入.
瞧.欢迎你,Future Me.
确保config/app.php文件中的提供程序列表中列出了Illuminate\View\ViewServiceProvider.
显然,容器中没有视图服务,这是设置它的设置.