Ошибка при использовании assets:dump в symfony2

У меня такая ошибка, когда я пытался ввести эту команду php app/console assetic:dump

[Assetic\Exception\FilterException]                                          
An error occurred while running:                                             
'/usr/local/bin/node' '/tmp/assetic_lesswt3ok6'                              

Error Output:                                                                
FileError: '../../bootstrap/less/bootstrap.less' wasn't found.               
 in mopabootstrapbundle.less:22:0                                            
21 // Main bootstrap.less entry point                                        
22 @import "../../bootstrap/less/bootstrap.less";                            
23                                                                           



Input:                                                                       
/*!                                                                          
 * MopaBootstrapBundle                                                       
 *                                                                           
 * Copyright 2011 Mohrenweiser & Partner                                     
 * Licensed under the Apache License v2.0                                    
 * http://www.apache.org/licenses/LICENSE-2.0                                
 *                                                                           
 * Import this file in your less files as first to be abled to access less   
vars from your file                                                          
 * OR                                                                        
 * Add it to the stylesheets of assetic or                                   
 * Add it as described on http://www.lesscss.org with the less.js (maybe pa  
thes must be adapted in that case)                                           
 *                                                                           
 * Be careful when using less this way, might be most straight forward, but  
 assetic doesnt check the included files                                     
 * for changes, and will only regenerate the css if it detects changes in t  
his file!                                                                    
 *                                                                           
 * For development it might be easier to include all you less files in the   
layout directly                                                              
 * But then assetic will compile each less file in a own compiler session s  
o you cant mix in the less style into bootstrap, which might not be OK       
 */                                                                          


// Main bootstrap.less entry point                                           
@import "../../bootstrap/less/bootstrap.less";                               

// variables                                                                 
@iconSpritePath:       "/bundles/mopabootstrap/bootstrap/img/glyphicons-hal  
flings.png";                                                                 
@iconWhiteSpritePath:  "/bundles/mopabootstrap/bootstrap/img/glyphicons-hal  
flings-white.png";                                                           

// The Paginator less for MopaBootstrapBundle                                
@import "paginator.less";                                                    

// The Subnav less for MopaBootstrapBundle                                   
@import "subnav.less";                                                       

// Collection support for MopaBootstrapBundle                                
@import "collections.less";                                                  

// Collection support for MopaBootstrapBundle                                
@import "google-maps.less";                                                  

// if you have any variables.less file INCLUDE IT AFTER EVERYTHING cause re  
sponsive.less also overrides it with the one from bootstrap!!!!!

Не понимаю от чего ошибка. Я пытался найти эту ошибку, но ни одно из решений не работает

Это мой файл ветки

{% block stylesheets %}
    {{ parent() }}
    {% stylesheets 
        filter='cssrewrite,?yui_css'
        'bundles/mopabootstrap/css/mopabootstrapbundle.css'
    %}
        <link href="{{ asset_url }}" rel="stylesheet" type="text/css" />
    {% endstylesheets %}
{% endblock %}

person david    schedule 06.11.2013    source источник
comment
Пожалуйста, покажите свой файл Twig с активной частью.   -  person A.L    schedule 06.11.2013
comment
Попробуйте определить параметр filter после пути к файлу CSS, как описано в документацию.   -  person A.L    schedule 13.11.2013
comment
FileError: '../../bootstrap/less/bootstrap.less' wasn't found. Существует ли этот файл?   -  person A.L    schedule 13.11.2013


Ответы (2)


У меня была такая же ошибка с пакетом mopabootstrap. Команда php app/console mopa:bootstrap:symlink:less, используемая для установки символической ссылки, правильно создает символическую ссылку в vendor/mopa/bootstrap-bundle/Mopa/Bundle/BootstrapBundle/Resources, но файл bootstrap.less по-прежнему не найден.

Поэтому я исправил это, скопировав папку vendor/twbs/bootstrap в vendor/mopa/bootstrap-bundle/Mopa/Bundle/BootstrapBundle/Resources. Это не очень правильное решение, но, по крайней мере, я могу сбросить активы.

person Kevin    schedule 17.02.2014
comment
В моем случае файлы mopabootstrap были сброшены в web/bundles, поэтому мне пришлось скопировать папку vendor/twbs/bootstrap в web/bundles/mopabootstrap. Неподходящее решение, но, как вы сказали, оно работает, и я тоже могу сбросить активы. - person Edhrendal; 08.03.2019

@Kevin прав, вот демо-решение для того, что дал Кевин:

php приложение/консоль mopa:bootstrap:symlink:less

Инициализация композитора... выполнена.

Проверка символической ссылки... не существует

Создание символической ссылки: /var/www/carsing/vendor/mopa/bootstrap-bundle/Mopa/Bundle/BootstrapBundle/Resources/public/bootstrap

для цели: ../../../../../../../twbs/bootstrap ... ОК

Как видите, для пакета mopa требуется (ссылка) bootstrap.

А теперь php app/console assetic:dump работает вообще без ошибок.

person Dung    schedule 02.06.2016