This is a simple short guide on how to install Sass on your Mac. If you receive an error whilst installing Sass, this article should provide a quick and simple solution. At the time of writing I am using macOS Sierra 10.12.5.
As macOS comes pre-installed with Ruby, installing Sass should be a simple matter of going to the command line (Utilities / Terminal Window) and typing:
gem install sass
However, if the following error is thrown, an elevated command is required (proceed to step 2).
ERROR: While executing gem … (Gem::FilePermissionError)
You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
sudo gem install sass
This solves the issue of file permissions, and Sass attempts installation. However, if a new error is thrown as follows, we must continue a step further (proceed to step 3).
Building native extensions. This could take a while…
ERROR: Error installing sass:
ERROR: Failed to build gem native extension.
Tools installation: xcode-select ‑‑install
Sass installation: sudo gem install sass
Verify the install: sudo sass -v
Sass 3.5.1 (Bleeding Edge)
Congratulations, you have installed Sass. I hope this article has been of help to you, please see below for a concise screenshot of the process. If you would like to see a Windows version of this guide, please let me know.