简体   繁体   中英

Installing Compass on Mac OS X 10.12 Sierra

I am working on two separate machines; one that has Compass installed on it from when the machine was running OS X Yosemite (happy with this one); and one that I am trying to install Compass on that is currently running OS X Sierra (Not so happy about this one).

I had some trouble back in the day with gem install compass while running Yosemite and after searching Stack it seemed that the issue was a user could no longer write to the specified directory they were trying to when running this command. Some suggested using running sudo gem install compass (and this is how I got my first machine running Compass).

With this second machine I run sudo gem install compass and received the following error:

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 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.14 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/ffi-1.9.14/ext/ffi_c/gem_make.out

I am not very familiar with CLI. Why am I unable to install Compass on Mac OS X Sierra 10.12?

It looks like you missing the devel headers. I had a similar issue with another gem (ffi) and I solved it installing XCode (v. 8.0). Once downloaded make sure to open Xcode, some components are only installed after the first time you open it. After that try again to run gem install .

I installed Homebrew as part of one solution I was trying, which installs the Xcode Command Line tools. (I had intended to use Homebrew to install Ruby and Compass in a different directory because I was initially getting permissions errors when using $ sudo gem install compass .) Once I installed Homebrew, I was able to use $ gem install compass successfully.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM