我使用 scss 的 @import 语句将一些 scss 文件导入到一个较大的文件中。尝试转储资产时,出现以下异常:
$ php app/console assetic:dump --force --verbose
Dumping all dev assets.
Debug mode is on.
[file+] sf_project/app/../web/js/f389f05.js
sf_project/src/Theaterjobs/MainBundle/Resources/public/js/jquery-1.6.3.min.js
[file+] sf_project/app/../web/js/f389f05_jquery-1.6.3.min_1.js
sf_project/src/Theaterjobs/MainBundle/Resources/public/js/jquery-1.6.3.min.js
[file+] sf_project/app/../web/css/e9b81fe.css
sf_project/src/Theaterjobs/MainBundle/Resources/assets/css/_base.scss
sf_project/src/Theaterjobs/MainBundle/Resources/assets/css/_structure.scss
sf_project/src/Theaterjobs/MainBundle/Resources/assets/css/theaterjobs.scss
[RuntimeException]
Exception trace:
() at sf_project/vendor/assetic/src/Assetic/Filter/CompassFilter.php:278
Assetic\Filter\CompassFilter->filterLoad() at sf_project/vendor/assetic/src/Assetic/Filter/FilterCollection.php:62
Assetic\Filter\FilterCollection->filterLoad() at sf_project/vendor/assetic/src/Assetic/Asset/BaseAsset.php:83
Assetic\Asset\BaseAsset->doLoad() at sf_project/vendor/assetic/src/Assetic/Asset/FileAsset.php:57
Assetic\Asset\FileAsset->load() at sf_project/vendor/assetic/src/Assetic/Asset/BaseAsset.php:92
Assetic\Asset\BaseAsset->dump() at sf_project/vendor/assetic/src/Assetic/Asset/AssetCollection.php:97
Assetic\Asset\AssetCollection->dump() at sf_project/vendor/bundles/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:206
Symfony\Bundle\AsseticBundle\Command\DumpCommand->doDump() at sf_project/vendor/bundles/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:163
Symfony\Bundle\AsseticBundle\Command\DumpCommand->dumpAsset() at sf_project/vendor/bundles/Symfony/Bundle/AsseticBundle/Command/DumpCommand.php:62
Symfony\Bundle\AsseticBundle\Command\DumpCommand->execute() at sf_project/vendor/symfony/src/Symfony/Component/Console/Command/Command.php:214
Symfony\Component\Console\Command\Command->run() at sf_project/vendor/symfony/src/Symfony/Component/Console/Application.php:194
Symfony\Component\Console\Application->doRun() at sf_project/vendor/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:75
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at sf_project/vendor/symfony/src/Symfony/Component/Console/Application.php:118
Symfony\Component\Console\Application->run() at sf_project/app/console:16
为提高可读性而缩短了路径:)
我们的 config.yml 看起来像这样
# Assetic Configuration
assetic:
debug: %kernel.debug%
use_controller: false
filters:
cssrewrite: ~
sass:
bin: /usr/local/bin/sass
compass:
bin: /usr/local/bin/compass
yui_js:
jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.6.jar"
我包括使用的样式表
{% stylesheets filter="compass,cssrewrite" '@TheaterjobsMainBundle/Resources/assets/css/*' %}
<link rel="stylesheet" href="{{ asset_url }}" type="text/css" media="screen" charset="utf-8" />
{% endstylesheets %}
我不知道是怎么回事。我将向您转储任何可能有助于解决此问题的输出。
谢谢!