LoginSignup
15
15

More than 5 years have passed since last update.

MacOS SierraでSassがインストール出来ない時の解決策

Last updated at Posted at 2018-02-28

はじめに

Sassのインストールをしようとすると下記エラーが出ました。
結構ハマる人多そうなので備忘録として残しておきます。

Sassとは

これからはcssはSassで書こう。

$sudo gem install sass
Building native extensions.  This could take a while...
ERROR:  Error installing sass:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.23/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180228-5487-11of4og.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.23 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/ffi-1.9.23/gem_make.out

解決策

Xcode コマンドラインツールをのインストール

$xcode-select --install
$sudo gcc --version

この後再度試して見るとインストール出来ました!

$sass -v
Sass 3.5.5 (Bleeding Edge)

参考にさせて頂きました。

MacOS Sierraでsassとcompassをインストールできない
Mac を El Capitan にアップデートしたあとに gem がコケる件

15
15
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
15