symfony - 在 Symfony 2.3.0-DEV 中配置 Assetic、Sass、Compass (Windows)

标签 symfony sass compass-sass assetic symfony-2.3

我将 Ruby 安装在 C:\Ruby200-x64 中,PATH 设置为 C:\Ruby200-x64\bin 并运行:

gem update --system
gem install sass
gem install compass

然后我在 app/config/config.yml 中配置了 Assetic:

ruby:           C:\Ruby200-x64\bin\ruby.exe
sass:           C:\Ruby200-x64\bin\sass.bat
filters:
    compass:
        bin: C:\Ruby200-x64\bin\compass.bat

app/Resources/views/base.html.twig中,我添加了样式表 block :

{% stylesheets
    'css/main.scss' filter="compass" %}
    <link rel="stylesheet" href="{{ asset_url }}" />
{% endstylesheets %}

scss 文件指向 /web/css/main.scss 以便在产品中进行测试,我将使用 bundles/bundlename/... 路径。

然后,当我尝试安装和转储 Assets 时:

php app/console assets:install
php app/console assetic:dump

我在以 .bat 结束路径时遇到此错误:

  [Assetic\Exception\FilterException]
  An error occurred while running:
  "C:\Ruby200-x64\bin\ruby.EXE" "C:\Ruby200-x64\bin\compass.bat" "compile" "C:\Users\Jes·s\AppData\Local\Temp" "--config" "C:\Users\Jes·s\AppData\Local\Temp\assC7D6.tmp" "--sass-dir" "" "--css-dir" "" "C:/Users/Jes·s/AppData/Local/Temp/assC7D7.tmp.scss"

  Error Output:
  C:/Ruby200-x64/bin/compass.bat:1: syntax error, unexpected tCONSTANT, expecting end-of-input

当不使用 .bat 扩展名时:

[Assetic\Exception\FilterException]
An error occurred while running:
"C:\Ruby200-x64\bin\ruby.exe" "C:\Ruby200-x64\bin\compass" "compile" "C:\Users\Jes·s\AppData\Local\Temp" "--config" "C:\Users\Jes·s\AppData\Local\Temp\ass52DB.tmp" "--sass-dir" "" "--css-dir" "" "C:/Users/Jes·s/AppData/Local/Temp/ass52DC.tmp.scss"

Error Output:
Configuration file, C:\Users\Jes·s\AppData\Local\Temp\ass52DB.tmp, not found or not readable.

我看到了这些(和其他):

最佳答案

没有 .bat 的版本是正确的,但看起来“Jes·s”文件夹名称会导致问题(应该有 u 带重音符号?)。

关于symfony - 在 Symfony 2.3.0-DEV 中配置 Assetic、Sass、Compass (Windows),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15677978/

相关文章:

html - 如何在另一个悬停的子元素的一个元素的::之后设置样式

html - 使悬停时的背景变暗

css - 我可以并行地将 css 转换为 scss 并将 scss 转换为 css 吗?

sass - 制作 Sprite 时, compass 在图像前扔正斜杠

security - Symfony 2 即使密码错误也会保留 _target_path

css - 当元素没有某个类的祖先时,如何有选择地应用 CSS

php - Symfony2 记住我不适用于 fos 用户包

css - 设计大型 ExtJS 应用程序的样式

php - 是否可以在 PHP 中创建可重用的 swagger 模板?

php - 如何处理 WampServer : Class 'Composer\Autoload\ClassLoader' not found? 上的此错误