Compass on Win using relative paths outside of Compass project dir
I was using Sass on an existing site and decided to get Compass up and running on Win7x64. Ruby, HAML, Compass all installed fine (afaik).
I have a project at c:\project
with a static files served out of c:\project\static
with a directory structure that has to stay the same. I went into c:\project\static
and ran this:
compass create css-compass
This resulted in the following dir structure
c:\project\static\css (previously existed; output css)
c:\project\static\css-sass (previously existed; source css)
c:\project\static\css-compass (the new compass dir created by compass)
And here is my config.rb:
# Require any additional compass plugins here.
# Set this to the root of your project when deployed:
http_path = "/"
css_dir = "..\\css开发者_运维知识库"
sass_dir = "..\\css-sass"
images_dir = "images"
javascripts_dir = "javascripts"
When I go to c:\project\static
and run compass watch compass-css
, I get the following error:
Nothing to compile. If you're trying to start a new project, you have left off the directory argument. Run "compass -h" to get help.
However, if I create symlinks inside c:\project\static\css-compass
from css->..\css
and css-sass => ..\css-sass
then everything works just fine.
What the what?
facepalm
Apparently you need to set relative_assets = true
in your config.rb file. Why this isn't the default is beyond me. Oh well!
im late :-)
You can also use relative Path's in project_path
Example
project_path = "../src/main/webapp/"
More Details in this Answer: Can't make grunt-contrib-compass work
精彩评论