【问题标题】:Django Compressor error compiling SASS (--scss Invalid Option)Django Compressor 编译 SASS 时出错(--scss 无效选项)
【发布时间】:2012-01-19 09:59:59
【问题描述】:

我在 Ubuntu 10.04 LTS 上设置了环境来运行 Django 网站,但它似乎不想玩得很好。环境如下:

Python      2.6.5  
Django      1.3.1  
Gunicorn    0.13.4  
Supvervisor 3.0  
Nginx       0.7.65  
Varnish     2.1

我为 Django 应用安装了以下相关模块:

django-appconf    0.4.1  
django-compressor 1.1.1  
django-smartagent 0.1.1  
Coffee Script     1.2.0
Sass              3.1.12

一切正常启动,但我收到以下模板错误:

Caught FilterError while rendering: invalid option: --scss

我已将其缩小到我的settings.py 文件中的这个元组列表:

(('text/coffeescript', 'coffee --compile --stdio'),
 ('text/less', 'lessc {infile} {outfile}'),
 ('text/x-sass', 'sass {infile} {outfile}'),
 ('text/x-scss', 'sass --scss {infile} {outfile}'))

看起来好像最后一行是造成所有这些麻烦的原因。

我在 Ubuntu 11.10 上进行了相同的设置,并且运行良好。我不确定发生了什么。

【问题讨论】:

    标签: python ruby django sass


    【解决方案1】:

    您安装了哪个版本的 Ruby?我怀疑您需要升级 Ruby,因为 SASS 需要 1.8.7 或更高版本(根据 SASS Changelog)。

    您能否确认您的 Ruby 版本,如果是 < 1.8.7,请尝试升级,看看是否能解决您的问题?

    编辑:根据Ubuntu Tech Specs,据说Ruby 1.8.7 包含在Ubuntu 10.04 LTS 中。也就是说,您可能想通过运行来确认 SASS 的版本:

    sass -v
    

    只是为了绝对确定……

    【讨论】:

    • 你完全正确。我忽略了 Ruby 的版本。我清除了打包版本并从源代码编译了最新的稳定版本。重复上述步骤并获得正确的版本。谢谢你,先生。
    猜你喜欢
    • 2021-12-09
    • 2013-10-21
    • 1970-01-01
    • 1970-01-01
    • 2014-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多