gruntjs / grunt-contrib-compass

Compile Compass to CSS.
http://gruntjs.com/
MIT License
626 stars 128 forks source link

Grunt Compass Operation Not Permitted #245

Closed tnethers closed 8 years ago

tnethers commented 8 years ago

Hello all,

I'm rather new to grunt and am loving it, but quite frustrated with my lack of success after moving to 'el capitan' with compass. From the grunt project directory, running 'grunt' has an EPERM error seemingly indicating that my 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.

tnethers commented 8 years ago

On further note, I've tried bypassing the grunt file and simply using sass to watch my file. It seems compass is not working Line 1: File to import not found or unreadable: compass referencing my line 1 (and likely 2) of: @import "compass"; @import "compass/layout/";

sindresorhus commented 8 years ago

The error is coming from Compass, not this plugin:

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

Seems you have some permission problems. Try reinstalling Sass. If not, Stack Overflow is where you'd want to ask support questions.