我正在使用 Windows 7 编译 .scss 和一个名为 Prepros 的应用程序。 (http://alphapixels.com/prepros/)。我还将 Gumby 框架( http://gumbyframework.com/ )下载到我的本地主机网络服务器的文档根目录中。我的目标是将 gumby 框架与 Prepros 一起使用。
当我尝试编译 scss 文件时,我收到以下错误:
Syntax error: Undefined operation: "power(golden_ratio(), 1) times 16px".
on line 52 of Z:/Ampps/www/Gumby-master/sass/extensions/modular-scale/stylesheets/_modular-scale.scss
from line 23 of Z:\Ampps\www\Gumby-master\sass\gumby.scss Use --trace for backtrace.
此外,如果有帮助,这是文件夹 www\Gumby-master 中包含的 config.rb 文件:
# Require any additional compass plugins here.
# Tell compass where to find local extensions
# If you followed directions and ran 'gem install modular-scale' comment the next two lines out:
extensions_dir = "sass/extensions"
Compass::Frameworks.register('modular-scale', :path => File.expand_path("# {extensions_dir}/modular-scale"))
# Uncomment these to use regular Ruby gems.
# require 'modular-scale'
# require 'sassy-math'
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "css"
sass_dir = "sass"
images_dir = "img"
# You can select your preferred output style here (can be overridden via the command line) :nested or :expanded or :compact or :compressed:
output_style = :compact
# To enable relative paths to assets via compass helper functions. Uncomment:
# relative_assets = true
# To disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
# If you prefer the indented syntax, you might want to regenerate this
# project again passing --syntax sass, or you can uncomment this:
# preferred_syntax = :sass
# and then run:
# sass-convert -R --from scss --to sass sass scss && rm -rf sass && mv scss sass
最后,我回顾了this线程,但我没有发现它有帮助。
最佳答案
解决方案:我尝试了几种方法来修复此问题,但我不确定是哪一种方法负责修复它。
- 安装 ruby 开发包
- 安装导轨
- 安装 gumby-framework gem ( https://github.com/jorgecoca/gumby-framework )
- 验证是否安装了模块化规模的 gem ( https://github.com/Team-Sass/modular-scale )
- 使用 Advanced Prepros 选项来使用第三方指南针插件 ( http://alphapixels.com/prepros/docs/sass-compass.html )(注意: 最初我错误地给出了这个路径
C:\Ruby193\lib\ruby\gems\1.9.1\gems
,实际上我意识到我必须提供这个C:\Ruby193\bin\ruby.exe
,就像Prepros手册中的图片一样。 )
-如所述in this thread ,我打开我的指南针 config.rb 并注释掉 Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale"))
,并取消注释 #require 'modular-scale'
和 #require 'sassy-math'
。
关于css - 尝试使用 Prepros 和 Gumby 编译 sass 时,如何修复此编译错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20461020/