【发布时间】:2017-11-10 20:37:25
【问题描述】:
我正在尝试将 SASS 与带有 symfony 的 Assetic 捆绑包一起使用。我遵循了主要教程here。但是,它不会生成任何 css 文件。我尝试过使用不同的输出,检查文件权限并弄乱过滤器,但我不太确定从这里去哪里。
相关的config.yml代码:
# Assetic Configuration
assetic:
debug: '%kernel.debug%'
use_controller: '%kernel.debug%'
filters:
cssrewrite: ~
scssphp:
bin: /usr/local/lib/ruby/gems/2.3.0/gems/sass-3.4.24
apply_to: .scss$
这是我的 stylesheet.html.twig,包含在我的 base.html.twig 中
{% stylesheets
'sass/style.scss'
filter = "scssphp" output='css/sass.css' %}
<link rel="stylesheet" href="{{ asset_url }}"/>
{% endstylesheets %}
我尝试使用以下命令行:
php bin/console assetic:dump --env=prod --no-debug
并得到以下错误:
[Assetic\Exception\FilterException]
An error occurred while running:
'/usr/local/lib/ruby' '/usr/local/lib/ruby/gems/2.3.0/gems/sass-3.4.24' '--
load-path' '/Applications/XAMPP/xamppfiles/htdocs/my_website/app/../web/sas
s' '--scss' '--load-path' '/Applications/XAMPP/xamppfiles/htdocs/my_website
/app/../web' '--cache-location' '/Applications/XAMPP/xamppfiles/htdocs/my_w
ebsite/var/cache/prod' '/private/var/folders/_2/xkw80vl13zj0xw0nm7j8c4bc000
0gn/T/assetic_sassqn8iBF'
Error Output:
sh: /usr/local/lib/ruby: is a directory
sh: line 0: exec: /usr/local/lib/ruby: cannot execute: Undefined error: 0
Input:
[...]
错误的其余部分只是我的 scss 文件。我不太确定错误告诉我什么。
谢谢:)
【问题讨论】: