Symfony2 : --reinstall issue

和自甴很熟 提交于 2019-12-13 13:24:00

问题


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).


回答1:


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




回答2:


Try to remove everything from "vendor" folder and run

php bin/vendors install

command




回答3:


Before you add in deps file copy all the content of deps file in any of your text editor,then delete all your contents of deps and add the Buzz link in deps only. Then try the below command

php bin/vendors install --reinstall

this will install the BUZZ bundle safely. After installing BUzz bundle you can paste all the deps content that you have copied earlier. If you are trying this make sure to download new symfony project and try this. May be this will helps you. I tried it earlier on one of my project.



来源:https://stackoverflow.com/questions/10621949/symfony2-reinstall-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!