类 'JMS\SerializerBundle\JMSSerializerBundle' 找不到 AppKernel



我是symfony的新手,我有以下问题。类 'JMS\SerializerBundle\JMSSerializerBundle' 在运行 composer install 命令时找不到 AppKernel。

这是我的应用内核文件:

$bundles = array(
        new SymfonyBundleFrameworkBundleFrameworkBundle(),
        new SymfonyBundleSecurityBundleSecurityBundle(),
        new SymfonyBundleTwigBundleTwigBundle(),
        new SymfonyBundleMonologBundleMonologBundle(),
        new SymfonyBundleSwiftmailerBundleSwiftmailerBundle(),
        new SymfonyBundleAsseticBundleAsseticBundle(),
        new DoctrineBundleDoctrineBundleDoctrineBundle(),
        new SensioBundleFrameworkExtraBundleSensioFrameworkExtraBundle(),
        new AppBundleAppBundle(),
        new JMSSerializerBundleJMSSerializerBundle(),
        new FOSUserBundleFOSUserBundle(),
        new FOSRestBundleFOSRestBundle(),
        new FOSOAuthServerBundleFOSOAuthServerBundle(),
        new NelmioApiDocBundleNelmioApiDocBundle(),
    );

这是我的作曲家.json文件。

{
"name": "gigi/api",
"license": "proprietary",
"type": "project",
"autoload": {
    "psr-4": {
        "": "src/"
    }
},
"require": {
    "php": ">=5.3.9",
    "symfony/symfony": "2.7.*",
    "doctrine/orm": "^2.4.8",
    "doctrine/doctrine-bundle": "~1.4",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~4.0",
    "sensio/framework-extra-bundle": "^3.0.2",
    "incenteev/composer-parameter-handler": "~2.0",
    "jms/metadata": ">=1.1.0,<1.3-dev",
    "jms/serializer": "dev-master",
    "jms/serializer-bundle": "dev-master",
    "friendsofsymfony/user-bundle": "2.0.*@dev",
    "friendsofsymfony/rest-bundle": "1.4.*@dev",
    "friendsofsymfony/oauth-server-bundle": "1.4.*@dev",
    "nelmio/api-doc-bundle": "2.5.*@dev"
},
"require-dev": {
    "sensio/generator-bundle": "~2.3",
    "symfony/phpunit-bridge": "~2.7"
},
"scripts": {
    "post-install-cmd": [
        "Incenteev\ParameterHandler\ScriptHandler::buildParameters",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
    ],
    "post-update-cmd": [
        "Incenteev\ParameterHandler\ScriptHandler::buildParameters",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
        "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::prepareDeploymentTarget"
    ]
},
"config": {
    "bin-dir": "bin",
    "platform": {
        "php": "5.3.9"
    }
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "symfony-assets-install": "relative",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    }
}

}

我做错了什么?

谢谢

似乎库不可用,因此您有两个选择:

  1. 您可以从 composer.json 中删除 jmsserializer 并将其用作:

    作曲家需要 JMS/序列化器捆绑包

  2. 我想保留作曲家.json,因为它是你可以运行的:

    作曲家更新 JMS/Serializer-bundle

编辑1:为什么会这样?当你运行composer install时,它将获取你的composer.lock文件,然后安装依赖项,正如你所看到的,symfony有一些安装后/更新脚本,它依赖于symfony安装,这需要JMS序列化程序在其引导过程中。在这种情况下,您的 composer.lock 已过时,因此您需要要求或更新缺少的包。

希望对您有所帮助!

相关内容

  • 没有找到相关文章

最新更新