【问题标题】:ErrorException JMS\SerializerBundle\JMSSerializerBundleErrorException JMS\SerializerBundle\JMSSerializerBundle
【发布时间】:2012-09-21 03:22:29
【问题描述】:

我正在尝试在 osx lion 上为以下项目 connect 安装供应商。

cd /tmp
git clone git://github.com/dsyph3r/connect
cd connect
git submodule update --init

php bin/vendors install

当我运行以下命令 php bin/vendors install 时,我收到以下消息:

[ErrorException]

Catchable Fatal Error:
Argument 1 passed to JMS\SerializerBundle\JMSSerializerBundle::__construct()
must implement interface Symfony\Component\HttpKernel\KernelInterface, 
none given, called in /Users/antoniopierro/Sites/connect/app/AppKernel.php on line 21
and defined in /Users/antoniopierro/Sites/connect/vendor/bundles/JMS/SerializerBundle/JMSSerializerBundle.php line 37

我错过了什么?

【问题讨论】:

    标签: macos symfony osx-lion


    【解决方案1】:

    您需要将内核传递给包的构造函数:

    $bundles = array(
        //...
        new JMS\SerializerBundle\JMSSerializerBundle($this),
        //...
    );
    

    【讨论】:

    • 这个项目已经 7 个月了,为什么它不起作用:JMSSerializerBundle 的代码已经改变
    • @greg0ire @elnur,感谢您的回答。现在它可以工作了,但我遇到了与app/config/parameters.ini 相关的另一个问题,请参阅以下问题:Fatal error: Class 'FOS\Rest\Util\Codes' not found
    猜你喜欢
    • 1970-01-01
    • 2023-03-25
    • 2017-12-20
    • 2013-01-06
    • 1970-01-01
    • 2014-06-20
    • 1970-01-01
    • 2023-03-11
    • 1970-01-01
    相关资源
    最近更新 更多