安装罗盘时出错。无法构建gem原生扩展(Compass)

时间:2014-08-18 11:39:50

标签: shell terminal install rvm compass-sass

安装SASS后,我做了:

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 ./siteconf20140818-5119-rfb64z.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

你有解决方案吗?

2 个答案:

答案 0 :(得分:7)

我有同样的问题,如果你像我一样使用ubuntu(我的是ubuntu 14),试试这个:

sudo apt-get install ruby-dev

答案 1 :(得分:2)

我遇到了同样的问题,经过以下Link后,我安装了Xcode并解决了我的问题。

尝试安装Xcode或Apple开发人员工具。