Sadiel
Sadiel

Reputation: 1384

Install JMSSerializerBundle

I installed FOSRestBundle but it needs JMSSerializerBundle.

I added in my deps the next lines:

[JMSSerializerBundle]
    git=git://github.com/schmittjoh/JMSSerializerBundle.git
    target=bundles/JMS/SerializerBundle

Here it explains how to do it: http://jmsyst.com/bundles/JMSSerializerBundle/master/installation

but when I try $php bin/vendors install it shows me an error:

[InvalidArgumentException]                                          
  The service definition "jms_serializer.serializer" does not exist.  

Upvotes: 2

Views: 7919

Answers (3)

Sadiel
Sadiel

Reputation: 1384

The manual says it to register the bundle with the kernel:

new JMS\Serializer\JMSSerializerBundle($this),

but the installer create the folder: vendor/bundles/JMS/SerializerBundle

so, it must be added the next line to the AppKernel.php instead of the other:

new JMS\SerializerBundle\JMSSerializerBundle($this),

Upvotes: 4

Wouter J
Wouter J

Reputation: 41934

You should comment the new FOS\RestBundle\FOSRestBundle(), line in AppKernel.php in the registerBundles() method. Then install the JmsSerializerBundle and after that you should decommend that line and register the JsmSerializerBundle.

Upvotes: 4

w1cked
w1cked

Reputation: 47

Did you also do the following steps from the manual? Sounds to me like you didn't add the line

new JMS\Serializer\JMSSerializerBundle($this)

to AppKernel.php

Upvotes: 2

Related Questions