将Laravel升级到4.1后,Artisan正在抛出异常

时间:2014-09-08 19:06:09

标签: laravel upgrade

我跟着these instructions to upgrade Laravel from 4.0 to 4.1。当我在浏览器上访问它时,应用程序似乎没问题。但是当我在终端上运行任何artisan命令时,我收到此错误:

{"error":{"type":"ReflectionException","message":"Class view does not exist","file":"\/my_app\/vendor\/laravel\/framework\/src\/Illuminate\/Container\/Container.php","line":501}}

所以,除了line 501 at Illuminate/Container/Container.php上的错误之外什么也没说。

我搜索了"Class view does not exist" on Google,发现几乎没有这样的内容。

由于我发现有些人遇到与服务提供商有关的类似问题,这是app/config/app.php上的服务提供商,以防它有用:

'providers' => array(
    'Illuminate\Foundation\Providers\ArtisanServiceProvider',
    'Illuminate\Auth\AuthServiceProvider',
    'Illuminate\Cache\CacheServiceProvider',
    'Illuminate\Foundation\Providers\CommandCreatorServiceProvider',
    'Illuminate\Session\CommandsServiceProvider',
    'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
    'Illuminate\Foundation\Providers\ComposerServiceProvider',
    'Illuminate\Routing\ControllerServiceProvider',
    'Illuminate\Cookie\CookieServiceProvider',
    'Illuminate\Database\DatabaseServiceProvider',
    'Illuminate\Encryption\EncryptionServiceProvider',
    'Illuminate\Filesystem\FilesystemServiceProvider',
    'Illuminate\Hashing\HashServiceProvider',
    'Illuminate\Html\HtmlServiceProvider',
    'Illuminate\Foundation\Providers\KeyGeneratorServiceProvider',
    'Illuminate\Log\LogServiceProvider',
    'Illuminate\Mail\MailServiceProvider',
    'Podesta\Mail\MailServiceProvider',
    'Illuminate\Foundation\Providers\MaintenanceServiceProvider',
    'Illuminate\Database\MigrationServiceProvider',
    'Illuminate\Foundation\Providers\OptimizeServiceProvider',
    'Illuminate\Pagination\PaginationServiceProvider',
    'Illuminate\Foundation\Providers\PublisherServiceProvider',
    'Illuminate\Queue\QueueServiceProvider',
    'Illuminate\Redis\RedisServiceProvider',
    'Illuminate\Remote\RemoteServiceProvider',
    'Illuminate\Auth\Reminders\ReminderServiceProvider',
    'Illuminate\Foundation\Providers\RouteListServiceProvider',
    'Illuminate\Database\SeedServiceProvider',
    'Illuminate\Foundation\Providers\ServerServiceProvider',
    'Illuminate\Session\SessionServiceProvider',
    'Illuminate\Foundation\Providers\TinkerServiceProvider',
    'Illuminate\Translation\TranslationServiceProvider',
    'Illuminate\Validation\ValidationServiceProvider',
    'Illuminate\View\ViewServiceProvider',
    'Illuminate\Workbench\WorkbenchServiceProvider',
    'Toddish\Verify\VerifyServiceProvider',
    'Former\FormerServiceProvider',
    'Basset\BassetServiceProvider',
    'Cviebrock\EloquentSluggable\SluggableServiceProvider',
    'Bootstrapper\BootstrapperServiceProvider',
    'KennedyTedesco\Validation\ValidationServiceProvider',
    'Intervention\Image\ImageServiceProvider',
    'Aws\Laravel\AwsServiceProvider',
    'Barryvdh\Debugbar\ServiceProvider',
    'Maatwebsite\Excel\ExcelServiceProvider',
),

我的composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.1.*",
        "toddish/verify": "2.*",
        "anahkiasen/former": "3.4.2",
        "jasonlewis/basset": "dev-master",
        "cviebrock/eloquent-sluggable": "1.0.*",
        "sebastian/money": "1.0.*",
        "intervention/image": "dev-master",
        "natxet/CssMin": "dev-master",
        "lmammino/jsmin4assetic": "1.0.*",
        "nitra/php-min": "dev-master",
        "raveren/kint": "dev-1.0.0-wip",
        "sebklaus/profiler" : "dev-master",
        "aws/aws-sdk-php-laravel": "1.*",
        "patricktalmadge/bootstrapper": "4.1.10",
        "kennedytedesco/validation": "dev-master",
        "tijsverkoyen/css-to-inline-styles": "1.2.*@dev",
        "facebook/php-sdk-v4": "dev-master",
        "goodby/csv": "*",
        "barryvdh/laravel-debugbar": "1.*",
        "maatwebsite/excel": "dev-master"
    },
    "autoload": {
        "classmap": [
            "app/libraries",
            "app/commands",
            "app/controllers",
            "app/models",
            "app/helpers",
            "app/exceptions",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan adjust:assets",
            "php artisan adjust:vendors",
            "php artisan optimize",
            "php artisan debugbar:publish"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}

我刚刚composer updatecomposer dump-autoload并使用composer install --prefer-source重新安装了供应商软件包。 app/storage/logs上没有任何内容。

所以,基本上现在我不能运行任何artisan命令,我不知道为什么。

我可以做些什么来尝试修复它?

1 个答案:

答案 0 :(得分:1)

好吧,我找到了一个解决方案,以防万一有人遇到类似的问题。

似乎无法在Illuminate之前列出任何服务提供商。就我而言,我只是在'Podesta\Mail\MailServiceProvider'之后放'Illuminate\Workbench\WorkbenchServiceProvider',现在artisan正在运作。