0
votes

i have recently implemented the grunt task runner on my Node.js project and i'm using grunt-contrib-compass and grunt-contrib-watch in order to compile my sass and compass code through grunt whenever i make any changes.

My grunt file is like this:-

module.exports = function(grunt) {
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        compass: {
            dist: {
                options: {
                    sassDir: 'public/sass',
                    cssDir: 'public/css'
                }
            }
        },
        watch: {
            css: {
                files: '**/*.scss',
                tasks: ['compass']
            }
        }
    });
    grunt.loadNpmTasks('grunt-contrib-compass');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.registerTask('default',['watch']);
}

I'm using windows and whenever i run grunt it watches for my sass files but whenever i make a change to these files i get this error:-

Warning: Couldn't find the 'compass.bat' binary. Make sure it's installed and in you $PATH Use --force to continue

I have installed ruby and compass through the ruby command prompt and the compass version is 1.0.3 and my gem installer version is 2.4.6. I have also tried including c:\Ruby200\bin to my Environmental variables and yes grunt-contrib-compass is installed in my Node.js project. I have tried everything, if anyone else has any experience in this i would love to hear from you. Thanks a lot.

1
If you try running compass alone on the command line what happens? If you type set PATH do you see the directory that contains compass.bat?Andrew Lavers
No its okay, everything works set PATH returns the environmental variables and compass gives out help information. Turns out all i needed was to restart my computer. HEHE :D. Thanks anyways.Jonathan Kumar

1 Answers

2
votes

You just need to install Ruby and follow this steps:

  • npm install grunt-contrib-compass
  • Reinstall Ruby gem installer 1.9.3 with checked all checkbox
  • On ruby console - gem install sass
  • On ruby console - gem install compass