mac/sass编译问题小记

mac上在使用sass编译时遇到下列报错。


找不到ffi,那就尝试安装一下,但是也遇到了问题。
错误信息:Failed to build gem native extension

这种一般来说可能是Command Line Tools没有安装好,记得之前是需要完整安装Xcode,但是我并不需要这个开发工具,这就很尴尬。找了一通发现现在已经不需要先安装Xcode才能安装Command Line Tools。

MacOS上一些第三方工具可能需要有Command Line Tools才能运行。
MacOS 10.10+后无需像之前一样必须先安装Xcode才能安装Command Line Tools,打开终端,输入xcode-select --install即可。
安装完毕后 再次打开终端输入xcode-select --install提示command line tools are already installed则表示安装成功。

  1. 安装command line tools。
xcode-select --install

弹出安装程序后直接安装即可。

  1. 再次输入命令验证是否安装完成
xcode-select --install
  1. 全局安装ffi,中间可能需要几十秒,成功!


  2. 重新试一把sass,报错
    错误信息exception while processing events: incompatible character encodings: ASCII-8BIT and UTF-8 Backtrace
    错误原因:watch编译的路径不能有中文。

  3. 换个路径重试sass,成功!


你可能感兴趣的:(mac/sass编译问题小记)