2014-02-18 79 views
1

的Symfony 2.4Symfony的2发生错误执行时 “作曲家安装” 命令

当我运行composer install我看到这样的错误:

Generating autoload files 

Fatal error: Class 'Doctrine\ORM\Tools\Console\Command\ClearCache\CollectionRegionCommand' not found in /Users/vpx/www/vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/Command/Proxy/CollectionRegionDoctrineCommand.php on line 29 
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-install-cmd event terminated with an exception 



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

"doctrine/orm": "~2.2,>=2.2.3"在composer.json更改后"doctrine/orm": "~2.2.3"好吧。这是为什么?

回答

0

您确实以您可能未看到的方式更改了版本。

"doctrine/orm": "~2.2,>=2.2.3" 

这允许从2.2.3(上次限制)开始的版本不超过3.0但是2.9999.9999。

"doctrine/orm": "~2.2.3" 

这允许从2.2.3开始的版本不超过2.3.0但是2.2.9999。

因此,您的更改实际上不允许版本2.3。*和现在,这可能是失败的原因,因为该特定的库已经有版本2.4.2,现在不允许。

您可能应该更新该版本的要求,因为它似乎执行某些更新的安装后命令不适用于此库的2.2.x版本。我建议至少使用~2.3,因为这样也会排除2.2.2版本和之前的版本。

0

尝试运行composer update而不是composer install

如果这样做不起作用,请尝试使用"doctrine/orm": "dev-master"替换"doctrine/orm": "~2.3.3",composer.json

+1

如果可以避免使用分支,请勿使用分支。这会让事情变得更糟。 – Sven