简体   繁体   English

在Mac OS X 10.12 Sierra上安装Compass

[英]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); 从机器运行OS X Yosemite时开始就安装了Compass的计算机(对此感到满意); and one that I am trying to install Compass on that is currently running OS X Sierra (Not so happy about this one). 我正在尝试在当前正在运行OS X Sierra的计算机上安装Compass的计算机(对此并不满意)。

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. 那天我在运行优胜美地时使用gem install compass遇到了一些麻烦,并且在搜索Stack之后,似乎问题是用户无法再运行该命令时尝试写入的指定目录。 Some suggested using running sudo gem install compass (and this is how I got my first machine running Compass). 一些建议使用运行sudo gem install compass (这是我让我的第一台计算机运行Compass的方式)。

With this second machine I run sudo gem install compass and received the following error: 在第二台机器上,我运行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 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. 我对CLI不太熟悉。 Why am I unable to install Compass on Mac OS X Sierra 10.12? 为什么我无法在Mac OS X Sierra 10.12上安装Compass?

It looks like you missing the devel headers. 好像您缺少devel标头。 I had a similar issue with another gem (ffi) and I solved it installing XCode (v. 8.0). 我在另一个gem(ffi)上也遇到了类似的问题,并通过安装XCode(v。8.0)解决了该问题。 Once downloaded make sure to open Xcode, some components are only installed after the first time you open it. 下载完成后,请确保打开Xcode,仅在首次打开Xcode后才安装某些组件。 After that try again to run gem install . 之后,再次尝试运行gem install

I installed Homebrew as part of one solution I was trying, which installs the Xcode Command Line tools. 我安装Homebrew是我尝试的一种解决方案的一部分,该解决方案安装了Xcode命令行工具。 (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. (我曾打算使用Homebrew在其他目录中安装Ruby和Compass,因为使用$ sudo gem install compass时最初会出现权限错误。)安装Homebrew之后,我便能够成功使用$ gem install compass

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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