【发布时间】:2016-04-08 06:51:44
【问题描述】:
我正在尝试使用 vagrant 安装预制的开发环境。最后一个组件是 symfony2。控制台抛出错误(如下所示)。关于修复可能是什么的任何想法?我试过用谷歌搜索它们,但没有运气。感谢您提供任何见解!
安装日志:
==> default:
==> default:
==> default: [Symfony\Component\Config\Exception\FileLoaderLoadException]
==> default: Cannot import resource "/srv/wealthbot/vendor/friendsofsymfony/jsrouting-bundle/Resources/config/routing/routing.xml" from "/srv/wealthbot/app/config/routing.yml".
==> default:
==> default:
==> default:
==> default: [InvalidArgumentException]
==> default: [ERROR 1866] Element '{http://symfony.com/schema/routing}route', attribute 'path': The attribute 'path' is not allowed. (in /srv/wealthbot/ - line 6, column 0)
==> default:
==> default:
==> default: cache:warmup [--no-optional-warmers]
==> default: Warming up the cache for the prod environment with debug false
==> default:
来自 /srv/wealthbot/vendor/friendsofsymfony/jsrouting-bundle/Resources/config/routing/routing.xml 的 routing.xml:
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="fos_js_routing_js" path="/js/routing.{_format}">
<default key="_controller">fos_js_routing.controller:indexAction</default>
<default key="_format">js</default>
<requirement key="_format">js|json</requirement>
</route>
</routes>
来自 /srv/wealthbot/app/config/ 的 routing.yml :
# Internal routing configuration to handle ESI
#_internal:
# resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
# prefix: /_internal
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /profile
fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /register
fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /resetting
fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /profile
fos_user_group:
resource: "@FOSUserBundle/Resources/config/routing/group.xml"
prefix: /group
fos_js_routing:
resource: "@FOSJsRoutingBundle/Resources/config/routing/routing.xml"
NelmioApiDocBundle:
resource: "@NelmioApiDocBundle/Resources/config/routing.yml"
prefix: /api/doc
【问题讨论】:
-
你使用哪个 Symfony 版本?
-
这是在主 composer.json 中指定为“require”的一组组件和版本。安装脚本运行 composer install --prefer-source。 gist.github.com/sidatgt/b216533b1ad7cef630286f550c17f79e
-
快速更新:我现在看到这个错误是由安装脚本中的缓存清除和预热命令触发的。这是安装脚本:gist.github.com/sidatgt/1db49d813937ea6cc11d058621d04d9d 有 4 个缓存命令,每个命令都会触发相同的错误。 routing.xml 中的参数无效
标签: php symfony composer-php