首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在尝试使用Prepros和Gumby编译sass时,如何修复此编译错误?

在尝试使用Prepros和Gumby编译sass时,如何修复此编译错误?
EN

Stack Overflow用户
提问于 2013-12-09 08:17:12
回答 3查看 3.7K关注 0票数 3

我正在使用windows7和一个叫做Prepros的应用程序来编译.scss。(http://alphapixels.com/prepros/ )。我还将Gumby Framework(http://gumbyframework.com/)下载到本地主机web服务器的文档根目录中。我的目标是使用gumby框架和Prepros。

当我尝试编译scss文件时,我收到以下错误:

代码语言:javascript
复制
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- config.rb中的主文件:

代码语言:javascript
复制
# 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线程,但我没有发现它有什么帮助。

EN

回答 3

Stack Overflow用户

发布于 2013-12-09 11:42:49

解决方案:我尝试了几种方法来解决这个问题,我不知道到底是哪一种方法解决了这个问题。

  • Install ruby development kit
  • Install rails
  • Install gumby-framework (https://github.com/jorgecoca/gumby-framework)
  • Verify ( https://github.com/Team-Sass/modular-scale)
  • Use高级Prepros选项以使用第三方指南针插件(http://alphapixels.com/prepros/docs/sass-compass.html) (注意:最初我错误地提供了此路径C:\Ruby193\lib\ruby\gems\1.9.1\gems,但实际上我意识到我必须提供此路径C:\Ruby193\bin\ruby.exe,就像Prepros手册中的图片一样。)

-as说in this thread,我打开我的指南针config.rb并注释掉了Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale")),并取消了对#require 'modular-scale'#require 'sassy-math'的注释。

票数 3
EN

Stack Overflow用户

发布于 2014-08-10 18:55:47

我也遇到了同样的问题。所以我想分享我所做的事情。

Gumby框架README.md文件声明“注意:请使用模块化的scale 1.0.6,2.x尚未集成”。确保您的机器上安装的modular scale版本是1.0.6!

如何检查?

Ruby200让我们假设你的安装的位置是“C:\

  1. ”。
  2. 转到C:\Ruby200\lib\ruby\gems\2.0.0\gems。在这个目录中,您将看到机器上安装的所有gem。(您应该看到sass、compass、modular-scale等)
  3. 确保它显示为"modular-scale-1.0.6“。如果没有,那么删除你那里的版本。如果你在这里看到了多个时髦的数学,不用担心。我们只需要机器上的一个模数比例!

如何安装Modular Scale v1.0.6?

  1. 运行gem安装模块化-scale v1.0.6

还有什么需要注意的?

就像丹尼尔说的打开你的config.rb。请确保其中包含以下代码行!

代码语言:javascript
复制
#Require any additional compass plugins here.
require 'modular-scale'
require 'sassy-math'   

无论您做什么,都不要在config.rb文件中包含以下代码。要让这段代码真正工作,您必须在您的sass目录中有一个名为extensions的目录,并且您必须将所有模块化规模的二进制文件复制到该目录中。

代码语言:javascript
复制
extensions_dir = "sass/extensions"
Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale"))

如果您遇到任何其他问题,并设法解决它,请在这里添加您的答案!目前整个安装体验都很糟糕。

票数 1
EN

Stack Overflow用户

发布于 2014-09-10 19:03:07

Parth Shah的+1 --这对我很有效。但是安装modular-scale 1.0.6的命令实际上是:

gem安装模块化规模的-v 1.0.6

他漏掉了v前面的连字符。

顺便说一句,到目前为止,Gumby已经进行了更新,因此Gumby现在应该可以与这些指南针、sass和模块化版本一起工作--请参阅下面的安装命令。

gem安装指南针-v0.12.4,gem安装sass -v3.2.18 gem安装模块化-v2.0.4

我仍然在运行旧版本,但这个更新已经得到了其他Gumby用户的确认。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20461020

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档