SOLVED: SASS Install issue Mac OS Sierra

I am trying to install Sass on macOS Sierra but get the error below. I’ve tried looking on stack overflow and there are similar questions, but no solutions that help me.

Thank you in advance.

Jermaine


Jermaines-MBP:~ jermainesmith$ gem install sass
Fetching: ffi-1.9.18.gem (100%)
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
Jermaines-MBP:~ jermainesmith$ sudo gem install sass
Password:
Building native extensions. This could take a while…
ERROR: Error installing sass:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 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

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.18 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.18/ext/ffi_c/gem_make.out
Jermaines-MBP:~ jermainesmith$

I just tried installing SASS and mine worked.

$ sudo gem install sass
Password:
Fetching: rb-fsevent-0.10.2.gem (100%)
Successfully installed rb-fsevent-0.10.2
Fetching: ffi-1.9.18.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.18
Fetching: rb-inotify-0.9.10.gem (100%)
Successfully installed rb-inotify-0.9.10
Fetching: sass-listen-4.0.0.gem (100%)
Successfully installed sass-listen-4.0.0
Fetching: sass-3.5.1.gem (100%)
Successfully installed sass-3.5.1
Parsing documentation for rb-fsevent-0.10.2
Installing ri documentation for rb-fsevent-0.10.2
Parsing documentation for ffi-1.9.18
Installing ri documentation for ffi-1.9.18
Parsing documentation for rb-inotify-0.9.10
Installing ri documentation for rb-inotify-0.9.10
Parsing documentation for sass-listen-4.0.0
Installing ri documentation for sass-listen-4.0.0
Parsing documentation for sass-3.5.1
Installing ri documentation for sass-3.5.1
Done installing documentation for rb-fsevent, ffi, rb-inotify, sass-listen, sass after 14 seconds
5 gems installed

What version of ruby are you using?

Mine is
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]

My gem is $ gem -v
2.6.12

I am using the following version of Ruby


Jermaines-MBP:~ jermainesmith$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
Jermaines-MBP:~ jermainesmith$

without going too deep; it sounds like a permission problem run whoami in the command, to acquire the permissions so you may, use either the sudo command prior to you command, or sudo su as a stand alone command prior.

I did try the sudo command in the command and as a stand alone command prior @GantzterDesignsInc but it didn’t work. I’m going to look at the permissions I’ve set up - thanks for your pointers though

SOLVED!

I needed to install the command line developer codes first.

xcode-select --install

I am now running Sass version 3.5.1 (Bleeding Edge) and have learned a lot in the process.

2 Likes

Awesome @MrDjango ! i know naDa of sass or Ruby but im looking forward to the journey!! drowning in trying to understand how to implement SOAP right now );

1 Like

Upgrading from Mac OS Sierra 10.12 to Mac OS Sierra 10.13.1

Tried to install sass through terminal on Mac and this is the issue:

ERROR: Error installing sass:
ERROR: Failed to build gem native extension.

This is was after upgrading to Mac OS Sierra version 10.13.1

So then I performed a --> xcode-select --install <-- in the terminal to install the command tools line.
Then typed --> sudo gem install sass <-- to install sass and didn’t come back with any errors
Check to see if it installed --> sass -v <-- and it worked.
Running version Sass 3.5.3 (Bleeding Edge)

Hope This is helps!

3 Likes

It depends on what each one of us has in her/his box. A quicker way to fix your issue is to read a log file it tells you exactly how to fix it if you have a recent Mac OS version 10.13.2. I read this thread and came across replies that say need to install xcode. I knew I installed xcode but anyways I tried again to install xcode and it says you have it installed. Hence this didn’t fix the issue in my case.

I went back to the error message “failed to build germ native extension” and searched in the bottom for the line where it says look into the log file. In my case the file name is mkmf.log and it gave me the location as well. I opened it and it says right there that “you didn’t agree to xcode …”, and I do have a habit to avoid signing or agreeing on anything so I must have skipped this step when I installed Xcode. It says to execute “sudo xcodebuild -license” which I did and followed the directions to agree. After that I was able to lunch the command “sudo gem install sass” and installed sass successfully.

to sum, each one of us has different setup on her/his machine, and in my humble view the quickest way to resolve the issues is to trust log files and stop ignoring it :slight_smile:

Can’t thank you enough for this fix @reezun720. Worked for me :clap:

1 Like

Thanks for this, I had the exact same issue and this fixed it!

1 Like

I am trying to install sass through xcode but still it doesn’t work. I get below pop up when I try to install xcode and after that nothing happens. Can anyone tell me what’s wrong with it ?

I am currently using High Sierra version 10.13.5 and got the alert: “Error installing sass:
ERROR: Failed to build gem native extension.” when trying to install Sass via terminal on my Mac OS. I used your suggestion exactly and I currently and thankfully now have Sass 3.5.7 installed. Thanks a bunch!

Youre welcome, Glad that I can help

You’re welcome glad that I can help