简体   繁体   English

将Sylius捆绑软件安装到Symfony 2.4中时,Composer依赖项错误

[英]Composer dependency error when installing Sylius Bundles into Symfony 2.4

I have problems installing Sylius Bundles (namely SyliusProductBundle) into a fresh Symfony 2.4 install 我在新的Symfony 2.4安装中安装Sylius捆绑包(即SyliusProductBundle)时遇到问题

rm -rf * .gitignore .travis.yml
composer create-project symfony/framework-standard-edition ./ 2.4.* --prefer-dist

Symfony install goes through with no errors: Clearing the cache for the dev environment with debug true Installing assets using the hard copy option Installing assets for Symfony\\Bundle\\FrameworkBundle into web/bundles/framework Installing assets for Acme\\DemoBundle into web/bundles/acmedemo Installing assets for Sensio\\Bundle\\DistributionBundle into web/bundles/sensiodistribution Symfony安装过程没有错误:调试为true清除开发环境的缓存使用硬拷贝选项安装资产将Symfony \\ Bundle \\ FrameworkBundle的资产安装到web / bundles / framework中将Acme \\ DemoBundle的资产安装到web / bundles / acmedemo将Sensio \\ Bundle \\ DistributionBundle的资产安装到Web / Bundle / sensiodistribution中

On we go, next to installing the bundles - let's first use the way it's described in the docs : 在安装软件包的过程中,我们首先使用文档中描述的方法:

composer require "sylius/product-bundle":"1.0.*@dev"

fails: 失败:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for sylius/product-bundle 1.0.*@dev -> satisfiable by sylius/product-bundle[1.0.x-dev].
    - sylius/product-bundle 1.0.x-dev requires sylius/resource-bundle 1.0.*@dev -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Installation failed, reverting ./composer.json to its original content.

I've tried several things (including an install of Doctrine Bundle 1.3 which led to even more errors referring to some Class missing and thus failing to clear the cache): 我已经尝试了几件事(包括安装Doctrine Bundle 1.3,这导致更多错误,导致某些类丢失,因此无法清除缓存):

2.2751   19015200   9. require('-ABSOLUTE PATH HERE-vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/CollectionRegionDoctrineCommand.php') -ABSOLUTE PATH HERE-vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:120

Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception



  [RuntimeException]
  An error occurred when executing the "'cache:clear --no-warmup'" command.

I've read that it might be a problem with my configuration which is why I made sure that the system timezone is set correctly which it definetely is. 我已经读到我的配置可能有问题,这就是为什么我要确保正确定义系统时区的原因。 My set up reads as follows: Mac OS X 10.9 MAMP free with PHP 5.4.10, installed Extensions include XDebug and XCache I'm out of luck on this one and would appreciate a solution. 我的设置如下:Mac OS X 10.9 MAMP(免费)和PHP 5.4.10,已安装扩展包括XDebug和XCache我对此并不满意,希望能找到一个解决方案。

Thanks! 谢谢!

As suggested, my composer.json 根据建议,我的composer.json

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "~2.4",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~2.3",
        "sensio/framework-extra-bundle": "~3.0",
        "sensio/generator-bundle": "~2.3",
        "incenteev/composer-parameter-handler": "~2.0"
    },
    "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"
        ],
        "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"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.4-dev"
        }
    }
}

You have to add "minimum-stability": "dev" to your composer.json 您必须在composer.json中添加“ minimum-stability”:“ dev”

here is you composer.json with "sylius/product-bundle":"1.0.*@dev" 这是带有“ sylius / product-bundle”的composer.json:“ 1.0。* @ dev”

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "~2.4",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~2.3",
        "sensio/framework-extra-bundle": "~3.0",
        "sensio/generator-bundle": "~2.3",
        "incenteev/composer-parameter-handler": "~2.0",
"sylius/product-bundle":"1.0.*@dev"
    },
"minimum-stability": "dev",
    "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"
        ],
        "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"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.4-dev"
        }
    }
}

Would there be a problem if I just updated my doctrine-bundle to ~1.3. 如果我将我的学说捆绑更新为〜1.3,会不会有问题。

After I did this I ran a composer update. 完成此操作后,我运行了作曲家更新。 And then did a require sylius product bundle. 然后进行了需求sylius产品捆绑销售。 Worked alright! 工作正常!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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