rubygemsnpmgrunt-contrib-watchgrunt-contrib-compass

Compass Fails Post Migration to 'El Capitan'


I'm rather new to grunt and am loving it, but quite frustrated with my lack of success with compass after moving to 'el capitan'. From the grunt project directory, running 'grunt' has an EPERM error seemingly indicating that sass/scss fails to compile with the compass/watch combo:

sh-3.2# grunt
Running "compass:dev" (compass) task
unchanged img/common/1x-scb9effd9a6.png
unchanged img/common/2x-sd9683d03fa.png
Errno::EPERM on line ["512"] of /Library/Ruby/Gems/2.0.0/gems/sass-3.4.19/lib/sass/plugin/compiler.rb: Operation not permitted - /Applications/MAMP/htdocs/Repos/dev/wp-content/themes/quindodo/_/css/giving.css
Run with --trace to see the full backtrace
Warning: ↑ Use --force to continue.

Grunt file is as follows:

module.exports = function(grunt) {

//All configuration goes here
grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),

    compass: {
        dev: {
            options: {              
                sassDir: 'sass',
                cssDir: 'css',
                fontsDir: 'fonts',
                imagesDir: 'img',
                images: 'img',
                javascriptsDir: 'js/pro',
                //environment: 'development',
                outputStyle: 'compressed',
                relativeAssets: false,
                httpPath: '.',
            }
        },
    },

    watch: {
            compass: {
            files: ['*.{scss,sass}'],
            tasks: ['compass:dev'],
        }

    },
});
// Where we tell Grunt we plan to use this plug-in.
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');

// Where we tell Grunt what to do when we type "grunt" into the terminal.
grunt.registerTask('default',['compass','watch']);
};

Lastly, my package.json

 {
"name": "quindido",
"version": "0.0.0",
"description": "Quindodo Theme CSS",
"private": true,
"devDependencies": {
 "grunt": "~0.4.5",
 "grunt-contrib-jshint": ">=0.10.0",
 "grunt-contrib-nodeunit": ">=0.4.1",
 "grunt-contrib-sass": ">0.0.1",
 "grunt-contrib-watch": ">0.0.1"
  }
 }

I will be hugely thankful for a solution. I tried disabling CIP. I also tried 'sudo gem install -n /usr/local/bin compass' as well as 'gem update --system'. I think I've successfully uninstalled and re-installed npm and the modules. I also just tried removing 'grunt-contrib-compass' from the devDependencies.


Solution

  • I solved this issue by uninstalling all binaries/gems, including ruby, and updating the path from /usr/bin to /usr/local/bin. Depending on your original OS, etc. your path can be in various hidden files. After updating the path, reinstall your binaries so that they're installed and run from /usr/local/bin. Try utilizing the following terminal commands to locate your binaries/active ruby:

    gem e
    ruby version