Compass can't find any Sass files to compile

iamgarrett picture iamgarrett · Sep 7, 2014 · Viewed 9.1k times · Source

Trying to learn Grunt. I have installed the grunt-contrib-compass,and grunt-contrib-watch plugins. When I use grunt in terminal, it runs the compass task and comes back with

Running "compass:dist" (compass) task
Compass can't find any Sass files to compile.
Is your compass configuration correct?.
If you're trying to start a new project, you have left off the directory argument.
Run "compass -h" to get help.`

The Gruntfile is in the wp-content/ folder of my Wordpress install. Here is the compass setup in my Grunfile:

compass: {
    dist: {
        options: {
            config: 'themes/THEME-NAME/config.rb',
            force: true
        }
    }
},

My config.rb is there, and is setup thusly:

require 'singularitygs'
require "breakpoint"
http_path = "/"
css_dir = "/"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"
output_style = :compressed
line_comments = false

Any ideas? Where have I gone wrong?

Answer

Jeff Burnz picture Jeff Burnz · Dec 7, 2014

I had this problem also, you don't have to change the css or sass dir paths in config.rb, all you do is set the basePath in Gruntfile.js - this tells compass where to run from, otherwise it defaults to the same directory as your Grunfile, which is clearly wrong.

The docs are here: https://github.com/gruntjs/grunt-contrib-compass

compass: {
  uikit: {
    options: {
      config: 'styles/uikit/config.rb',
      basePath: 'styles/uikit',
      bundleExec: true
    }
  }
}