0

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?

iamgarrett
  • 49
  • 1
  • 7
  • Changing the paths in the config.rb to be relative to where the Gemfile is (ex: sass_dir = "themes/THEME-NAME/sass") gives me a slew of errors regarding my singularitygs and breakpoint gems. BUT it doesn't act as if there is no files to compile. Progress? – iamgarrett Sep 07 '14 at 01:51

4 Answers4

4

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
    }
  }
}
Lorenz Lo Sauer
  • 23,698
  • 16
  • 85
  • 87
Jeff Burnz
  • 163
  • 7
1

APPARENTLY when you use a config.rb in another directory, set your config.rb's variable paths relative to the Gruntfile's directory and it should all work.

ChrisF
  • 134,786
  • 31
  • 255
  • 325
iamgarrett
  • 49
  • 1
  • 7
0

I also have this issue with my first sass project when I wanted to use Susy toolkit. You should type "compass watch" command from your working directory, and compass will do the rest. And then compile the main.scss file. If it shows like below...

modified C:/xampp/htdocs/projects/sass/config.rb
clean C:/xampp/htdocs/projects/sass/css
delete C:/xampp/htdocs/projects/sass/css/main.css
write C:/xampp/htdocs/projects/sass/css/main.css

Then it's working. But at first, you have to configure your config.rb file.

Ajmal Aamir
  • 1,085
  • 8
  • 8
-4

This:

 sudo npm install --save-dev
Flavio Troia
  • 2,451
  • 1
  • 25
  • 27