简体   繁体   中英

FOSRest gives fatal error in symfony 2

i am trying to install FOSRest & FOSRestBundle

initially , i have specified following settings in the deps

[FOSRest]
    git=git://github.com/FriendsOfSymfony/FOSRest.git
    target=fos/FOS/Rest


[FOSRestBundle]
    git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
    target=bundles/FOS/RestBundle

But that cause me into following error when i access http://localhost/Symfony/web/app_dev.php/

Fatal error: Declaration of FOS\\RestBundle\\Routing\\Loader\\RestRouteLoader::setResolver() must be compatible with that of Symfony\\Component\\Config\\Loader\\LoaderInterface::setResolver() in /home/logicase/public_html/Symfony/vendor/bundles/FOS/RestBundle/Routing/Loader/RestRouteLoader.php on line 29

After that i tried following setting to make to the master branch and above error remains the same

[FOSRest]
    git=git://github.com/FriendsOfSymfony/FOSRest.git
    target=fos/FOS/Rest
    version=origin/2.0

[FOSRestBundle]
    git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
    target=bundles/FOS/RestBundle
    version=origin/2.0

and now when i run php ./bin/vendors install

i get following message in console.

Installing/Updating FOSRest 5eb800bd63ba84e5fc7028386cb66373bc3efafc fatal: ambiguous argument 'origin/2.0': unknown revision or path not

in the working tree. Use '--' to separate paths from revisions

Installing/Updating FOSRestBundle c11ab9d990a1e0e979b1c8ab72cc9793b4b2dcb5 fatal: ambiguous argument 'origin/2.0': unknown revision or path not in the working tree.

I tried following settings for FOSRest which solved my problem for symfony 2

[FOSRest]
    git=git://github.com/FriendsOfSymfony/FOSRest.git
    target=fos/FOS/Rest
    version=origin/0.6

[FOSRestBundle]
    git=git://github.com/FriendsOfSymfony/FOSRestBundle.git
    target=bundles/FOS/RestBundle

As you can see, there is no 2.0 branch : https://github.com/FriendsOfSymfony/FOSRestBundle/branches https://github.com/FriendsOfSymfony/FOSRest/branches The installation documentation does not talk about it. You should just remove the version lines.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM