【问题标题】:Unable to find file "@SonataUserBundle/Resources/config/routing/admin_resetting.xml"找不到文件“@SonataUserBundle/Resources/config/routing/admin_resetting.xml”
【发布时间】:2016-02-21 20:53:39
【问题描述】:

今天我第一次安装了 Symfony 2.7.9,当然我已经安装了 Sonata Admin(成功)。现在我正在尝试像here 描述的那样安装 SonataUserBundle。但是我总是遇到同样的错误:

在中找不到文件“@SonataUserBundle/Resources/config/routing/admin_resetting.xml” @SonataUserBundle/Resources/config/routing/admin_resetting.xml(正在 从“/Users/alex/www/Personal/startup-1/app/config/routing.yml”导入)。确保 “SonataUserBundle”捆绑包已正确注册并加载到应用程序内核中 班级。如果捆绑包已注册,请确保捆绑包路径 “@SonataUserBundle/Resources/config/routing/admin_resetting.xml”不为空。

是的,当然我检查了 admin_ressetting.xml 并发现文件夹 @SonataUserBundle/Resources/config/routing 是空的。

这是我的文件:

config.ymlrouting.ymlsecurity.ylmAppKernel.php

我还要注意:

  1. 我的数据库包含 0 个表。
  2. 在文件夹 src/Application/Sonata 我只有一个文件夹 UserBundle

【问题讨论】:

  • 我刚刚查看了 Github 上的源代码,看来您只是缺少该文件。 github.com/sonata-project/SonataUserBundle/tree/master/… 有没有作曲家错误?
  • 我应该只添加那些文件吗?当我添加唯一的 admin_resetting.xml 时,出现了其他错误。安装包可能有问题?

标签: php xml symfony yaml


【解决方案1】:

看来 SonataUserBundle 的 2.2.4 版本确实存在问题。正如您所见there,确实缺少admin_ressetting.xml

仅供参考,我刚刚发布了an issue 报告错误。

您可以获取文件from the master branch并在vendor/sonata-project/user-bundle/Resources/config/routing下创建它以同时修复它。

更新 (2016 年 4 月 28 日)

事实上,这不是问题,而是文档误导(默认文档早于上一个版本)。如果要使用最新版本,目前是 2.2.4,则需要参考v2.2 documentation

【讨论】:

    【解决方案2】:

    如果你真的检查了应该位于 vendor/ 下的 @SonataUserBundle/Resources/config/routing 并且它是空的,我建议你删除供应商目录,清除作曲家缓存(compser clear-cache)并再次运行composer install

    正如您在 Github 上看到的,该目录不应为空,并且包含的​​文件多于 admin_resetting.xml

    【讨论】:

    • @SonataUserBundle/Resources/config/routing 位于 src/Application/Sonata/UserBundle 文件夹中
    • 为什么它位于 src/Application 下?你不是通过composer安装的吗?
    • 我是通过 composer 安装的,就像描述的 here
    • 是的,但是像“php composer.phar require sonata-project/user-bundle --no-update”这样的安装包应该位于由easy制作的vendor/包下-extends 主要是存储实体。配置应位于 vendor/ 下的 SonataUserBundle 中,而不是 src/ 中的 ApplicationSonataUserBundle 中。
    • vendor 文件夹下我有 sonata-project/user-bundle/ 在 ** vendor/sonata-project/user-bundle/Resources /config/routing** 我有以下文件:admin_security.xml、api.xml、sonata_change_password_1.xml、sonata_registration_1.xml、sonata_resetting_1.xml、sonata_security_1.xml。但没有 admin_ressetting.xml
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2023-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-04
    • 1970-01-01
    相关资源
    最近更新 更多