2013-12-09 30 views
3

我正在使用Windows 7來編譯名爲Prepros的應用程序.scss。 (http://alphapixels.com/prepros/)。我還將Gumby框架(http://gumbyframework.com/)下載到本地主機web服務器的文檔根目錄中。我的目標是與Prepros一起使用gumby框架。當我試圖用Prepros和Gumby編譯sass時,我該如何解決這個編譯錯誤?

當我試圖編譯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 \古比主內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線程,但我沒有發現它有用。

回答

3

解決方案:我嘗試了幾件事情來解決這個問題,我不是絕對哪個負責修復它。

-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'

1

我也遇到了完全相同的問題。所以我想分享我所做的事情。

Gumby框架README.md文件狀態「注意:請使用模塊化比例1.0.6,2.x尚未集成但尚未集成」。確保您的機器上安裝的模塊化秤的版本是1.0.6!

如何檢查?

  1. 讓我們假設你的Ruby安裝位置是「C:\ Ruby200」。
  2. 轉到C:\ Ruby200 \ lib \ ruby​​ \ gems \ 2.0.0 \ gems。在這個目錄中,你會看到機器上安裝的所有寶石。 (您應該看到sass,指南針,模塊化等等)
  3. 確保它說「模塊化 - 規模 - 1.0.6」。如果沒有,則刪除您在那裏的版本。如果你在這裏看到多個時髦數學,不要擔心。我們只需要一臺模塊化的機器!

如何安裝Modular Scale v1.0.6?

  1. 運行gem install modular-scale v 1.0。6

還有什麼需要注意的?

像Daniel說的那樣,打開你的config.rb。確保你有以下幾行內容!

#Require any additional compass plugins here. 
require 'modular-scale' 
require 'sassy-math' 

不管你做什麼,在你的config.rb文件中都沒有下面的代碼。爲了使代碼真正起作用,必須在sass目錄中有一個名爲extensions的目錄,並且必須將所有模塊化二進制文件複製到該目錄中。

extensions_dir = "sass/extensions" 
Compass::Frameworks.register('modular-scale', :path => File.expand_path("#{extensions_dir}/modular-scale")) 

如果您遇到任何其他問題並以某種方式設法解決它,請在此處添加您的答案!整個安裝過程目前非常糟糕。

0

爲Parth Shah +1 - 爲我工作。但命令來安裝模塊化規模1.0.6實際上是:

創業板安裝模塊化規模-v 1.0.6

他錯過了在V之前連字符

BTW按照這個日期,有一個Gumby更新,所以Gumby現在可以與這些指南針,sass和模塊化版本一起工作 - 請參閱下面的安裝命令。

寶石安裝指南針-v0.12.4, 創業板安裝青菜-v3.2.18 創業板安裝模塊化規模-v2.0.4

我還在使用舊版本,但此更新已被其他古比證實用戶。