Search code examples
phpsymfonyinstallationbundlevendors

Symfony2 : --reinstall issue


I have been trying to install Buzz for Symfony2. I added it to the deps file, and tried to update my vendors :

php bin/vendors update

The command simply tells me that I've installed the standard version, and that I should try to use :

php bin/vendors install --reinstall

instead. Which I did.

But then an error pops in and tells me :

Updating deps.lock
sh:/var/www/Symfony/vendor/bundles/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php: not found
PHP Fatal error:  Class 'Doctrine\Common\Annotations\AnnotationRegistry' not found in /var/www/Symfony/app/autoload.php on line 37
PHP Fatal error:  Class 'Doctrine\Common\Annotations\AnnotationRegistry' not found in /var/www/Symfony/app/autoload.php on line 37

And then nothing works anymore, which is not surprising because my vendors folder is almost empty.

Has anyone encountered this problem before? Any clue on how to fix it?

Edit :

I found out the origin of this error. I didn't have git installed, so I did :

sudo apt-get install git-core

Check this link for more info on that : http://comments.gmane.org/gmane.comp.php.symfony.symfony2/8239

However I'm having another error now ("Looked for namespace "buzz.client.curl", found none"). I'm making another thread for that one, as it is not the same problem (link here).


Solution

  • That's not the right way to update your vendors. Per the docs

    There is also a php bin/vendors update command, but this has nothing to do with upgrading your project and you will normally not need to use it. This command is used to freeze the versions of all of your vendor libraries by updating them to the version specified in deps and recording it into the deps.lock file.

    Ergo, all you need to do is run php bin/vendors install (I know, it's confusing. I partially blame them for poorly naming the sub-command)

    EDIT

    To help resolve your current issues, try these steps

    1. rm -rf vendor/*
    2. rm -rf app/cache/*
    3. rm app/bootstrap.php.cache
    4. php bin/vendors install

    Hope it works