• Mac安装compass失败的原因


    之前一直用的windows电脑,突然间切换成mac,各种不习惯,刚开始的时候连文件夹都找不到,悲催……

    还好,熟悉了两天之后,基本上也能够操作了。

    然后就是安装各种开发软件,由于个人习惯了使用sass开发css,所以使用命令行安装了sass,可是当安装compass的时候,悲剧发生了。

    一直提示:

    Building native extensions.  This could take a while...
    ERROR:  Error installing compass:
    	ERROR: Failed to build gem native extension.
    
        current directory: /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.17/ext/ffi_c
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20170302-3213-i36x9b.rb extconf.rb
    mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/include/ruby.h
    
    extconf failed, exit code 1
    
    Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.17 for inspection.
    Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/ffi-1.9.17/gem_make.out
    

    然后就是各种求助,也搜索了很多解决方案,可是真的,没有完全解决。知道在知乎上看到一个答案

    先xcode-select --install, 再sudo gem install compass, 然后compass -v 看到版本号,说明成功了,自 Xcode 5.0 开始,安装 Xcode 的命令行工具

     

    然后就是命令行执行xcode-select --install,不幸的是,又提示安装xcode软件,没办法,只能安装软件咯!

    漫长的下载时间,终于安装好之后,执行命令

    Building native extensions.  This could take a while...
    [[ASuccessfully installed ffi-1.9.17
    Fetching: rb-inotify-0.9.8.gem (100%)
    Successfully installed rb-inotify-0.9.8
    Fetching: compass-1.0.3.gem (100%)
    ERROR:  While executing gem ... (Errno::EPERM)
        Operation not permitted - /usr/bin/compass
    

    就是说依然安装失败,然后仔细看看这段报错提示, Operation not permitted - /usr/bin/compass  就是说/usr/bin/compass这个文件夹禁止操作,之前二次安装sass的时候,遇到过类似的提示,那就执行 sudo gem install -n /usr/local/bin compass

    终于提示安装成功了。反复折腾当中,对这几个安装命令都比较熟练了。

     

      

  • 相关阅读:
    392 单页面应用程序概述
    391 vue $refs:vue获取组件、DOM元素
    使用这些 CSS 属性选择器来提高前端开发效率!
    WEB网站常见受攻击方式及解决办法
    能用HTML/CSS解决的问题就不要使用JS
    两张图解释CSS动画的性能
    20个编写现代CSS代码的建议
    微信小程序之下载(下载文件tempFilePath后缀unknown)
    使用typescript构建Vue应用
    Vue模板语法、事件和表单使用
  • 原文地址:https://www.cnblogs.com/zhuhuoxingguang/p/6490912.html
Copyright © 2020-2023  润新知