Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS to Sass Installing Sass and Setting up the Project Installing and Updating Sass

Melinda Golden
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Melinda Golden
Full Stack JavaScript Techdegree Graduate 25,815 Points

Error updating Sass

I am trying to update Sass to the latest version but I am getting an error in the terminal. I am on OS X El Capitan.

Melindas-MacBook-Pro:~ melinda$ sass -v
Sass 3.4.22 (Selective Steve)
Melindas-MacBook-Pro:~ melinda$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
Melindas-MacBook-Pro:~ melinda$ sudo gem update sass
Password:
Updating installed gems
Updating sass
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
Nothing to update

3 Answers

FIXED!

You have to use the developer codes command first.

xcode-select --install

A new window will appear. Make sure install the software this will take a few minutes.

After that you use

sudo gem install sass

Alan Lopez
seal-mask
.a{fill-rule:evenodd;}techdegree
Alan Lopez
PHP Development Techdegree Student 6,830 Points

You rock! That solved my issue and it updated my version of Sass! Thank you! And I will take into account the fact the I will have to update, but for now, I have Ruby Sass 3.7.3.

Note: I am using a mac that had Xcode installed on it. I'm not sure if you would have the same result without having Xcode on your machine?

Jos Prins is correct (thanks!) β€”Β it looks like you have to install the command line developer tools first before installing sass using this method. I suspect this is probably relevant for anyone who has Xcode installed, but hasn't done much (if anything) with it from the command line yet.

Additional resources / explanation can be found both here on SO and also more detailed instructions in this article. :thumbsup:

Note: After (successfully) installing the command line developer tools as detailed above, I realized that Ruby Sass is now deprecated and will no longer be maintained after March 2019. Dart Sass is the new implementation.

So basically β€” while the above instructions do work β€” it appears they're no longer relevant. :sunglasses: