Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
16
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

@kolife

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

はじめに

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

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
16
Help us understand the problem. What are the problem?