2010-08-13 61 views
0
絕對路徑參數

我使用sass(從haml-edge)進行處理css文件,它絕對路徑當機參數:薩斯(紅寶石CSS壓縮機)在Windows

K:\sass>sass.bat k:/sass/css/*.scss k:/sass/css/*.css --trace 
d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/sass/files.rb:23:in `read': No such file or directory - k 
(Errno::ENOENT) 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/sass/files.rb:23:in `tree_for' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/sass/plugin.rb:220:in `update_stylesheet' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/sass/plugin.rb:71:in `block in update_stylesheets' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/sass/plugin.rb:71:in `each' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/sass/plugin.rb:71:in `update_stylesheets' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/haml/exec.rb:433:in `watch_or_update' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/haml/exec.rb:349:in `process_result' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/haml/exec.rb:41:in `parse' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/lib/haml/exec.rb:21:in `parse!' 
    from d:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/haml-edge-3.1.62/bin/sass:8:in `<top (required)>' 
    from d:/Programs/Ruby/bin/sass:19:in `load' 
    from d:/Programs/Ruby/bin/sass:19:in `<main>' 

我能夠使它通過註釋在split_colon_path一個條件(紅寶石\ LIB \紅寶石\寶石\ 1.9.1 \寶石\ HAML邊緣-3.1.62 \ LIB \ HAML \ exec.rb)工作:

def split_colon_path(path) 
    one, two = path.split(':', 2) 
    if one && two && #### this part was commented # ::Haml::Util.windows? && 
     one =~ /\A[A-Za-z]\Z/ && two =~ /\A[\/\\]/ 
    # If we're on Windows and we were passed a drive letter path, 
    # don't split on that colon. 
    one2, two = two.split(':', 2) 
    one = one + ':' + one2 
    end 
    return one, two 
end 

有沒有更好的平臺檢測解決方案?

+0

'sass' VS'K:/ SSAS /' - 是你的路徑一個錯字的第一個元素? – sarnold 2010-08-13 10:49:38

+0

@sarnold:替換實際路徑時的小錯字 – alexandrul 2010-08-13 11:16:25

回答

1

這是一個已知的錯誤。它已經在最新的Sass穩定版本中得到修復,除非你使用mingw Ruby,在這種情況下,它將在下一個穩定版本(本週末發佈)中得到修復。

+0

我使用mingw Ruby,感謝好消息。 – alexandrul 2010-08-14 09:27:56

1

問題在haml-edge 3.1.64解決。

爲了記錄在案,mingw添加到host_os可能值{Ruby folder}\lib\ruby\gems\1.9.1\gems\haml-edge-3.1.64\lib\haml\util.rb

# Whether or not this is running on Windows. 
# 
# @return [Boolean] 
def windows? 
    RbConfig::CONFIG['host_os'] =~ /mswin|windows|mingw/i 
end 
+0

感謝您的解釋。看起來你是在公共互聯網索引中解釋這個錯誤的人:) – user80805 2010-10-10 19:14:07