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 Compass Basics Getting Started with Compass Installing Compass

Laura Hill
Laura Hill
13,674 Points

Cant install Compass

Here is what I get: laurahillsmbp2:~ laurahill$ sass --version Sass 3.4.6 (Selective Steve) laurahillsmbp2:~ laurahill$ sudo gem install compass Building native extensions. This could take a while... ERROR: Error installing compass: ERROR: Failed to build gem native extension.

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

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.6 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/ffi-1.9.6/gem_make.out

Angela Dimler
Angela Dimler
7,969 Points

I'm having the same problem. Someone please help!

13 Answers

Laura Hill
Laura Hill
13,674 Points

Hi Julia, I ended up needing to kill the watch command I was running for the previous videos. Then I closed and opened the terminal, had to use sudo, etc. And suddenly it just worked. Keep trying!

Laura Hill
Laura Hill
13,674 Points

Hi Julia, Yes I used ctrl+c to stop watch. I downloaded the latest Xcode for this segment so I don't think it needed updating. I kept closing and opening the terminal. I closed all the sass and sublime files I had open. I lit a candle. I did a dance. I don't know what I finally did right, but it was nothing drastic. I'm using Xcode now for the iOS development track. I'll come back to you if I learn a helpful trick to it. Good luck.

Stephen Blank
Stephen Blank
16,286 Points

Hi Laura,

Did a quick search, and it sounds like the Ruby dev environment is not installed. It is required for compass

http://stackoverflow.com/questions/20559255/error-while-installing-json-gem-mkmf-rb-cant-find-header-files-for-ruby

Are you working on a Mac? Here is the Ruby download page:

https://www.ruby-lang.org/en/downloads/

Laura Hill
Laura Hill
13,674 Points

I had no problems installing sass, and Ruby comes with my mac. I also updated Ruby, successfully - is the Ruby dev environment different than just what Ruby comes install don the iMac?

Laura Hill
Laura Hill
13,674 Points

laurahillsmbp2:~ laurahill$ ruby --version ruby 2.0.0p451 (2014-02-24 revision 45167) [universal.x86_64-darwin13]

Laura Hill
Laura Hill
13,674 Points

laurahillsmbp2:~ laurahill$ $ brew install ruby -bash: $: command not found laurahillsmbp2:~ laurahill$

I'm having the same problem.

Interesting!! This forum claims it might be a problem with updating xcode, so I'm trying that as well, but I'll take a crack at that too! Thanks!

Did you use Ctrl + C to stop the watch command? I did that and re-opened terminal, but no luck. I will let you know if XCode changes anything!

Okay! I updated XCode...and now I'm getting a shorter error code! It's just a shorter version of the same "failure to build gem native extension." Maybe this is progress?? I will argue with terminal a little longer and see what turns up. :)

The problem is listed as "can't find header files." I'm going to try out this

SUCCESS! So, having updated Xcode, updated to Yosemite, updated ruby (apparently there are sometimes problems with ruby after updating to Yosemite?) and installing the command line developer tools....it worked! Successful installation of compass! Thank you stack overflow and kind treehouse forum denizens!

Laura Hill
Laura Hill
13,674 Points

Wow!! That was a lot of updating for a training course! Glad you solved it. I stopped short of Yosemite as I remain loyal to Forstall's design and I am boycotting as long as I can:) Please let us know how you find Yosemite. Happy Coding ! xx