2014-02-10 30 views
1

我剛剛建立了一個新的Symfony 2.4項目並嘗試安裝SonataAdminBundle(instruction),但我再次遇到錯誤。帶Symfony〜2.4的SonataAdminBundle - 如何安裝?

歷史

# install symfony (demo works!) 
composer create-project symfony/framework-standard-edition ./ 2.4.* 

# install admin bundle (instruction above) 
composer require sonata-project/admin-bundle 
-> version: dev-master 

# install DoctrineORMAdminBundle (FAILS!) 
composer require sonata-project/doctrine-orm-admin-bundle 
-> version: dev-master 

嗯,我失敗了step 1.2錯誤

Please provide a version constraint for the sonata-project/doctrine-orm-admin-bundle requirement: dev-master 
./composer.json has been updated 
Loading composer repositories with package information 
Updating dependencies (including require-dev) 
Generating autoload files 
Updating the "app/config/parameters.yml" file 

    [Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException] 
    The service "sonata.admin.builder.orm_datagrid" has a dependency on a non-existent service "sonata.admin.builder.filter.factory". 

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. 

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [packages1] ... [packagesN] 

有趣行:

The service "sonata.admin.builder.orm_datagrid" has a dependency on a non-existent service "sonata.admin.builder.filter.factory". 

有誰知道該怎麼辦?提前感謝!

+0

出了什麼問題?請告訴我們一些錯誤... –

+0

文檔的作曲者有什麼​​問題?至少嘗試使用那一個,然後告訴我們你得到的錯誤,而不是向我們展示一個乾淨的composer.json和AppKernel.php –

+0

@WouterJ請查看我的編輯,謝謝! –

回答

6

您必須註冊SonataAdminBundle和SonataDoctrineOrmAdminBundle。看起來你忘了激活SonataAdminBundle。

+3

感謝您的建議。在嘗試安裝SonataDoctrineORMAdminBundle之前,我必須執行步驟1.3和1.4。 –