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 trialMartin Jachyra
14,338 PointsInstalling Compass Error
When i try to install compass i get an error saying:
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 ./siteconf20140820-5382-tt21mm.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.3 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/ffi-1.9.3/gem_make.out
Im completely new to the terminal and command line so I'm completely lost.
6 Answers
Martin Jachyra
14,338 Pointshey guys thanks for the replies that didn't work either Sigouy Me, Fortunately i found online i needed to install Xcode.
For anyone else having this issue type $ xcode-select --install
You will then get a pop up to install Xcode. After, when you install compass it should work!!
Sigouy Mo
2,215 PointsApple updated the Xcode command line tools, which upgraded clang to Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn) and enabled a feature in clang that causes unknown compiler flags to hard error rather than warn.
For now you can work around the issue using:
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
and then try again
sudo gem install compass
Hope it helps.
Source: https://langui.sh/2014/03/10/wunused-command-line-argument-hard-error-in-future-is-a-harsh-mistress/
Nick Ocampo
15,661 PointsWhat command are you typing to install it and what OS are you on? Try
$ gem update --system
$ gem install compass
Martin Jachyra
14,338 Pointshey nick thanks for the reply. Those are i commands i wrote and am still having problem.
Martins-MacBook-Pro:~ Martin$ sudo gem update --system Latest version currently installed. Aborting. Martins-MacBook-Pro:~ Martin$ sudo gem install compass Building native extensions. This could take a while... and the whole error thing comes after.
i am on late 2013 macbook pro OS X 10.9.4
no current updates are available
eddytseng
20,560 PointsI am also still having these problems ever since I updated to Yosemite or El Capitan (I forgot when I started to see it). I am running on a MacBook Pro, Mid 2012 and currently on OS X 10.11.3. I've also tried all the solutions above.
Marco Boretto
29,821 Pointstry this out:
sudo gem install -n /usr/local/bin compass
David Ram
38 PointsI had the same problem, after installing the Xcode development tools I was still having the error while trying to install compass, I tried the below, according to this post
sudo ln -s /usr/bin/llvm-gcc /usr/bin/gcc-4.2
If that doesn't work out, try agreeing with the Xcode licenses
sudo gcc
Laura Hill
13,674 PointsLaura Hill
13,674 PointsHi Martin, I am getting the same error - but the Xcode isn't working. I don't want to mess around with my command line too much - but Im using a 2013 iMac. Installing Xcode is all you needed to do?
Jesus Asensio
13,435 PointsJesus Asensio
13,435 PointsThank you! Same problem and solved!
Tanya Scales
Courses Plus Student 1,008 PointsTanya Scales
Courses Plus Student 1,008 PointsHaving the same issue and this fixed it for me. Thank you for this!
In addition: If this doesn't help you and you have Xcode downloaded from the App Store and haven't actually opened it yet, then this may be what you need to do in order to get this working. Xcode needs to finish installing after you accept the user agreement in order for all this to come together.