1

私はSymfony2とcomposer.pharを使ってバンドルをインストールするのは初めてです。

新しいバンドルをインストールするたびにエラーが発生します。壊れているのが私のcomposer.jsonなのか、それともSymfonyの完全なインストールなのかわかりません。

# php composer.phar require friendsofsymfony/comment-bundle
Please provide a version constraint for the friendsofsymfony/comment-bundle requirement: dev-master
composer.json has been updated
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove symfony/symfony 2.1.x-dev
    - Can only install one of: symfony/symfony dev-master, symfony/symfony 2.1.x-dev.
    - Can only install one of: symfony/symfony 2.2.x-dev, symfony/symfony 2.1.x-dev.
    - don't install symfony/class-loader dev-master|don't install symfony/symfony 2.1.x-dev
    - Installation request for symfony/symfony == 2.1.9999999.9999999-dev -> satisfiable by symfony/symfony 2.1.x-dev.
    - Installation request for symfony/class-loader dev-master -> satisfiable by symfony/class-loader dev-master, symfony/symfony dev-master, symfony/symfony 2.2.x-dev.

作曲家はsymfonyをもう一度インストールする必要があると私に伝えようとしていますか?

これが私のcomposer.jsonです

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*",
        "symfony/class-loader": "dev-master",
        "friendsofsymfony/comment-bundle": "dev-master",
        "knplabs/knp-paginator-bundle": "dev-master",
        "facebook/php-sdk": "dev-master",
        "friendsofsymfony/facebook-bundle": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ],
        "post-update-cmd": [
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}

編集:これらのエラーのために、バンドルを手動でインストールする必要があり(FOSFacebookBundleなど)、vendors / composer / autoload_namespaces.phpを更新する必要がありました(ええ、それは悪いことです)

EDIT2:composer.pharアップデートを実行すると

# php composer.phar update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove symfony/symfony 2.1.x-dev
    - Conclusion: don't install symfony/symfony 2.1.x-dev
    - Conclusion: don't install symfony/symfony v2.1.4
    - Conclusion: don't install symfony/symfony v2.1.3
    - Conclusion: don't install symfony/symfony v2.1.2
    - Conclusion: don't install symfony/symfony v2.1.1
    - Conclusion: don't install symfony/symfony v2.1.0
    - Conclusion: don't install symfony/symfony v2.1.0-RC2
    - Conclusion: don't install symfony/symfony v2.1.0-RC1
    - Conclusion: don't install symfony/symfony v2.1.0-BETA4
    - Installation request for friendsofsymfony/facebook-bundle dev-master -> satisfiable by friendsofsymfony/facebook-bundle dev-master.
    - Conclusion: don't install symfony/symfony v2.1.0-BETA3
    - Installation request for symfony/class-loader dev-master -> satisfiable by symfony/class-loader dev-master, symfony/symfony dev-master, symfony/symfony 2.2.x-dev.
    - Conclusion: don't install symfony/symfony v2.1.0-BETA2
    - friendsofsymfony/facebook-bundle dev-master requires symfony/twig-bundle >=2.1,<2.3-dev -> satisfiable by symfony/symfony 2.1.x-dev, symfony/symfony 2.1.x-dev, symfony/symfony 2.2.x-dev, symfony/symfony v2.1.0, symfony/symfony v2.1.1, symfony/symfony v2.1.2, symfony/symfony v2.1.3, symfony/symfony v2.1.4, symfony/twig-bundle 2.1.x-dev, symfony/twig-bundle 2.2.x-dev, symfony/twig-bundle v2.1.0, symfony/twig-bundle v2.1.1, symfony/twig-bundle v2.1.2, symfony/twig-bundle v2.1.3, symfony/twig-bundle v2.1.4.
    - Can only install one of: symfony/symfony v2.1.0-BETA1, symfony/symfony 2.2.x-dev.
    - don't install symfony/twig-bundle 2.1.x-dev|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle 2.2.x-dev|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.0|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.1|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.2|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.3|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.4|don't install symfony/symfony v2.1.0-BETA1
    - Installation request for symfony/symfony 2.1.* -> satisfiable by symfony/symfony 2.1.x-dev, symfony/symfony v2.1.0, symfony/symfony v2.1.0-BETA1, symfony/symfony v2.1.0-BETA2, symfony/symfony v2.1.0-BETA3, symfony/symfony v2.1.0-BETA4, symfony/symfony v2.1.0-RC1, symfony/symfony v2.1.0-RC2, symfony/symfony v2.1.1, symfony/symfony v2.1.2, symfony/symfony v2.1.3, symfony/symfony v2.1.4.

ご協力いただきありがとうございます。

4

1 に答える 1

1

答えが見つかりました!

symfony/class-loader見た目は単純ですが(私にとってはそうではありません)、正しいバージョンを参照していないという依存関係がありました。

したがって、私がしなければならなかったのは、クラスローダーを削除することだけで、すべてが正常です。

于 2012-12-06T14:12:41.083 に答える