mac安装compass失败

http://www.cnblogs.com/zhuhuoxingguang/p/6490912.html

 

 

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

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

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

一直提示:

1
2
3
4
5
6
7
8
9
10
11
12
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软件,没办法,只能安装软件咯!

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

1
2
3
4
5
6
7
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

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

转载于:https://www.cnblogs.com/kevoin/p/7069768.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值