0

ディレクトリを正しく監視しているコンパスでエラーが発生しますが、出力を生成できません。私は、それが私のファイルGEMFILEまたはcompass.rb設定ファイルに関係していると考えています。

    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.

ガードファイル

# 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/

コンパスがコンパイルに失敗する理由がわからない?

編集:

ファイル構造

4

1 に答える 1

0

sass_path絶対パスである必要があります。あなたの構成では、それは相対的です。

コメントアウトしてみてください。既にsass_dir.

これで問題が解決しない場合は、プロジェクトのディレクトリ構造を共有してください。

于 2013-04-11T05:36:03.733 に答える