这是 config.rb 的一个示例:
# Require any additional compass plugins here.
require 'compass/import-once/activate'
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "../../assets/css"
sass_dir = "../../assets/css/scss"
# 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 disable debugging comments that display the original location of your selectors. Uncomment:
line_comments = false
# Enable source map
sourcemap = true
有了这个 config.rb 设置,你的项目文件夹应该像(如你所写):
MyFolder
├ app
├ build
│ └ compass
│ └ config.rb
└ assets
├ css/
│ └ scss/
├ js
└ img
如果您没有 config.rb,只需创建一个新文件“config.rb”并复制/粘贴到我编写的配置中。
打开你的终端,输入 MyFolder/build/compass 然后启动你的 compass 命令,比如:compass watch
记住
您必须在 config.rb 文件所在的同一文件夹中执行您的 compass 命令。所以在这种情况下,在 MyFolder/build/compass 中。否则指南针不起作用。