2012-08-01 114 views
0

当我在我的symfony项目中安装sonata-admin软件包时。我已经配置我的YML文件如下:无法在symfony2中安装sonata-admin软件包

sonata_block: 
    default_contexts: [cms] 
    blocks: 
     sonata.admin.block.admin_list: 
      contexts: [admin] 
     sonata.block.service.text: 
     sonata.block.service.action: 
     sonata.block.service.rss: 

和我的hve DEPS文件如下:

[SonataAdminBundle] 
    git=git://github.com/sonata-project/SonataAdminBundle.git 
    target=/bundles/Sonata/AdminBundle 
    version=origin/2.0 

我收到以下错误

安装/更新SonataAdminBundle a25d8c0e084ed4a175b89a93e93bdea2cf5563ab 致命的:无法查找github.com(端口9418)(没有这样的主机是已知的。)

[Symfony\Component\Config\Exception\FileLoaderLoadException] 

    Cannot import resource "C:\wamp\www\Symfony\app/config\config.yml" from "C:\wa 
mp\www\Symfony\app/config/config_dev.yml". 




    [InvalidArgumentException] 




    There is no extension able to load the configuration for "sonata_block" (in C: 
\wamp\www\Symfony\app/config\config.yml). Looked for namespace "sonata_block", f 
ound "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "ass 
etic", "sensio_framework_extra", "jms_security_extra", "acme_hello", "acme_task" 
, "ensl_jobeet", "acme_demo", "web_profiler", "sensio_distribution" 











    [Symfony\Component\Config\Exception\FileLoaderLoadException] 

    Cannot import resource "C:\wamp\www\Symfony\app/config\config.yml" from "C:\wa 
mp\www\Symfony\app/config/config_dev.yml". 











    [InvalidArgumentException] 




    There is no extension able to load the configuration for "sonata_block" (in C: 
\wamp\www\Symfony\app/config\config.yml). Looked for namespace "sonata_block", f 
ound "framework", "security", "twig", "monolog", "swiftmailer", "doctrine", "ass 
etic", "sensio_framework_extra", "jms_security_extra", "acme_hello", "acme_task" 
, "ensl_jobeet", "acme_demo", "web_profiler", "sensio_distribution" 

我应该在这种情况下做

回答

1

当您尝试安装您的厂商似乎它不能与github.com联系与混帐:协议,这就是为什么它是说,它无法使用9418端口进行联系,该端口是git协议使用的端口。这可能是由于某些防火墙阻止了该端口或任何类似的原因。由于它无法下载SonataAdmin代码,因此您可以获得所有其他错误。

你可以做的是用http:协议替换git:协议,它也可以用来访问github。因此,只要改变你的DEPS到:

[SonataAdminBundle] 
    git=http://github.com/sonata-project/SonataAdminBundle.git 
    target=/bundles/Sonata/AdminBundle 
    version=origin/2.0 

,它应该工作