mac安装compass失败

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

 

 

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

还好,熟悉了两天以后,基本上也可以操做了。windows

而后就是安装各类开发软件,因为我的习惯了使用sass开发css,因此使用命令行安装了sass,但是当安装compass的时候,悲剧发生了。xcode

一直提示:sass

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

而后就是各类求助,也搜索了不少解决方案,但是真的,没有彻底解决。知道在知乎上看到一个答案ruby

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

 

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

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

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命令行

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

相关文章
相关标签/搜索