Ryan
Ryan

Reputation: 75

Sylius Fresh Installation: can't install "sensio/generator-bundle"?

I am new to Sylius and I have just installed a fresh Sylius project on my Mac, it is working fine. Then I realised that I need to create my own bundle under src to overwrite the Sylius bundles. Usually, I will use "php app/console generate:bundle" to generate a bundle skeleton, but the "sensio/generator-bundle" is not integrated with the default Sylius project so I will need to install it first via composer, but it seems I couldn't do that because of the dependency error, below is the error result

Problem 1

- Conclusion: don't install sensio/generator-bundle v2.5.1
- Installation request for sensio/generator-bundle ~2.5 -> satisfiable by sensio/generator-bundle[v2.5.0, v2.5.1].
- Conclusion: remove symfony/symfony v2.3.25
- sensio/generator-bundle v2.5.0 requires symfony/console ~2.5 -> satisfiable by symfony/symfony[v2.5.0, v2.5.1, v2.5.10, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8, v2.5.9, v2.6.0, v2.6.1, v2.6.2, v2.6.3, v2.6.4], symfony/console[v2.5.0, v2.5.1, v2.5.10, v2.5.2, v2.5.3, v2.5.4, v2.5.5, v2.5.6, v2.5.7, v2.5.8, v2.5.9, v2.6.0, v2.6.1, v2.6.2, v2.6.3, v2.6.4].
- don't install symfony/console v2.5.0|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.1|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.10|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.2|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.3|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.4|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.5|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.6|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.7|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.8|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.5.9|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.6.0|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.6.1|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.6.2|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.6.3|don't install symfony/symfony v2.3.25
- don't install symfony/console v2.6.4|don't install symfony/symfony v2.3.25
- Can only install one of: symfony/symfony[v2.5.0, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.1, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.10, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.2, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.3, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.4, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.5, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.6, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.7, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.8, v2.3.25].
- Can only install one of: symfony/symfony[v2.5.9, v2.3.25].
- Can only install one of: symfony/symfony[v2.6.0, v2.3.25].
- Can only install one of: symfony/symfony[v2.6.1, v2.3.25].
- Can only install one of: symfony/symfony[v2.6.2, v2.3.25].
- Can only install one of: symfony/symfony[v2.6.3, v2.3.25].
- Can only install one of: symfony/symfony[v2.6.4, v2.3.25].
- Installation request for symfony/symfony == 2.3.25.0 -> satisfiable by symfony/symfony[v2.3.25].

Below is my composer.json (a fresh installation)

{
"name":        "sylius/sylius-standard",
"description": "Sylius SE, modern e-commerce solution for Symfony2",
"keywords":    ["symfony", "symfony2", "sylius", "distribution", "ecommerce", "cart"],
"type":        "project",
"license":     "MIT",
"homepage":    "http://sylius.org",
"authors": [
    {
        "name":     "Paweł Jędrzejewski",
        "homepage": "http://pjedrzejewski.com"
    },
    {
        "name":     "Sylius project",
        "homepage": "http://sylius.org"
    },
    {
        "name":     "Community contributions",
        "homepage": "http://github.com/Sylius/Sylius/contributors"
    }
],
"require": {
    "php":                                  ">=5.3.3",
    "sylius/sylius":                        "0.12.*@dev",

    "doctrine/doctrine-bundle":             "@dev",
    "doctrine/migrations":                  "@dev",
    "doctrine/doctrine-migrations-bundle":  "@dev",
    "friendsofsymfony/user-bundle":         "@dev",
    "knplabs/knp-gaufrette-bundle":         "@dev",
    "knplabs/knp-snappy-bundle":            "@dev",
    "liip/doctrine-cache-bundle":           "@dev",
    "mathiasverraes/money":                 "@dev",
    "pagerfanta/pagerfanta":                "@dev",
    "white-october/pagerfanta-bundle":      "@dev",
    "friendsofsymfony/oauth-server-bundle": "@dev",
    "willdurand/hateoas-bundle":            "1.0.*@dev",
    "jms/serializer-bundle":                "0.13.*@dev",
    "friendsofsymfony/rest-bundle":         "~1.5@dev"
},
"require-dev": {
    "behat/behat":                       "~3.0",
    "behat/symfony2-extension":          "~2.0@dev",
    "behat/mink-extension":              "~2.0@dev",
    "behat/mink-browserkit-driver":      "~1.2@dev",
    "behat/mink-selenium2-driver":       "@dev",
    "behat/mink":                        "~1.6@dev",
    "doctrine/doctrine-fixtures-bundle": "2.2.*",
    "fzaninotto/faker":                  "~1.2",
    "phpspec/phpspec":                   "~2.0",
    "phpunit/phpunit":                   "~3.7"
},
"scripts": {
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreate"
    ],
    "post-update-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Symfony\\Cmf\\Bundle\\CreateBundle\\Composer\\ScriptHandler::downloadCreate"
    ]
},
"autoload": {
    "psr-0": {
        "": "src/",
        "Context": "features/"
    }
},
"config": {
    "bin-dir": "bin"
},
"extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    }
}
}

Is it possible to install the generator bundle or is there another way to create a bundle?

Thanks

Upvotes: 2

Views: 554

Answers (1)

Wouter J
Wouter J

Reputation: 41934

This is the important line in the error message: sensio/generator-bundle v2.5.0 requires symfony/console ~2.5 Followed by Conclusion: remove symfony/symfony v2.3.25

This means: (a) you have Symfoy 2.3.25 installed and (b) you want to require a version of the SensioGeneratorBundle which requires at least Symfony 2.5.

You can solve it in 2 ways:

  • Bump the Symfony version constraint to ~2.5
  • Require a version of the SensioGeneratorBundle that is compatible with Symfony 2.3.

Upvotes: 4

Related Questions