指南针失败后迁移到El Capitan'

时间:2015-11-12 22:34:00

标签: gem npm grunt-contrib-watch grunt-contrib-compass

我对咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜咕噜呜呜呜呜呜呜呜从grunt项目目录中,运行' grunt'有一个EPERM错误似乎表明sass / scss无法使用指南针/手表组合进行编译:

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文件如下:

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']);
};

最后,我的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"
  }
 }

我将非常感谢解决方案。我试过禁用CIP。我也试过&sudo gem install -n / usr / local / bin compass'以及' gem update --system'。我想我已经成功卸载并重新安装了npm和模块。我也试过删除' grunt-contrib-compass'来自devDependencies。

1 个答案:

答案 0 :(得分:0)

我通过卸载所有二进制文件/ gem(包括ruby)并将/ usr / bin中的路径更新到/ usr / local / bin来解决了这个问题。根据您的原始操作系统等,您的路径可以是各种隐藏文件。更新路径后,重新安装二进制文件,以便安装它们并从/ usr / local / bin运行。尝试使用以下终端命令来查找二进制文件/活动ruby:

gem e
ruby version