2013-04-11 129 views
0

我收到一個錯誤,指南針正確觀察我的目錄,但無法生成我的輸出。我認爲它與我的GEMFILEcompass.rb配置文件有關。Bundler配置編譯sass文件

ERROR: Guard::Compass failed to achieve its <run_on_change>, exception was: 
Compass::Error: Nothing to compile. If you're trying to start a new project, you have left off the directory argument. 

Guardfile

# More info at 
# https://github.com/guard/guard#readme 
# https://github.com/guard/guard/wiki/Guardfile-examples 

# Launch Guard like this: [bundle exec] guard -g ui 

group :ui do 

# guard :bundler, 
# :hide_success => true do 
# watch('Gemfile') 
# end 

    guard 'compass', 
    :output => 'client/css', 
    :workdir => 'source/sass', 
    :configuration_file => 'config/compass.rb', 
    :hide_success => true do 
    #watch('source/sass/(.*)\.scss') 
    watch(/source\/sass\/(.*)\.s[ac]ss/) 

    end 

end 

而且我compass.rb文件

require 'sass' 
require 'compass' 

# Require any additional compass plugins here. 

# Get the directory that this configuration file exists in 
dir_src = File.dirname(__FILE__) 

# Set this to the root of your project when deployed: 
http_path = "/" 
project_path = File.join(dir_src, "../", "") 

sass_dir = "source/sass" 
sass_path = sass_dir 

css_dir = "client/css" 
#css_path = File.join(dir_src, "client", "css") 

#images_dir = "img" 
#images_path = File.join(dir_src, "../public", "img") 

#javascripts_dir = "js" 
#javascripts_path = File.join(dir_src, "../public", "js") 

#Environment 
#environment = :development 

# You can select your preferred output style here (can be overridden via the command line): 
# output_style = :expanded or :nested or :compact or :compressed 
output_style = :expanded 

# 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 
debug_info = false 

我的文件夾結構是與我的頂級目錄如下。

project/ 
    client/ 
    css 
    source/ 
    sass/ 

不確定爲什麼指南針無法編譯?

編輯:

FILE STRUCTURE

回答

0

sass_path應該是一個絕對路徑。在你的配置中,它是相對的。

試着評論一下,你已經有sass_dir

如果這沒有幫助,請分享您的項目目錄結構。

+0

更新並添加了我的文件夾結構,我評論說sass_path定義,我仍然收到相同的錯誤。 – Warz 2013-04-11 15:53:18

+0

通過直接觀看我的客戶端路徑來解決問題。 – Warz 2013-04-13 23:04:44

+0

我從問一個關於流星和sass的單​​獨問題中發現的答案。 http://stackoverflow.com/questions/15912907/meteor-js-scss-compass。關於刪除sass_path和使用相對路徑的答案有所幫助。我會考慮這個答案 – Warz 2013-04-14 19:59:11