Help us understand the problem. What is going on with this article?

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

More than 1 year has passed since last update.

はじめに

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 がコケる件

admin-guild
「Webサービスの運営に必要なあらゆる知見」を共有できる場として作られた、運営者のためのコミュニティです。
https://admin-guild.slack.com
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした