发布于 2014-12-27 10:07:30 | 3017 次阅读 | 评论: 1 | 来源: PHPERZ
Compass CSS样式框架
Compass由SASS的核心团队成员Chris Eppstein创建,是一个非常丰富的样式框架,包括大量定义好的mixin,函数,以及对SASS的扩展。
本文为大家讲解的是安装compass时出现ERROR: Failed to build gem native extension...... -- mkmf (Load Error)解决办法,感兴趣的同学参考下。
Compass由SASS的核心团队成员Chris Eppstein创建,是一个非常丰富的样式框架,包括大量定义好的mixin,函数,以及对SASS的扩展。通过ruby gem可以安装它。
[sudo] gem install compass
在安装时报错如下:
Fetching: sass-3.4.0.gem (100%)
Fetching: multi_json-1.10.1.gem (100%)
Fetching: compass-core-1.0.1.gem (100%)
Fetching: compass-import-once-1.0.5.gem (100%)
Fetching: chunky_png-1.3.1.gem (100%)
Fetching: rb-fsevent-0.9.4.gem (100%)
Fetching: ffi-1.9.3.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing compass:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:4:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/ffi-1.9.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/ffi-1.9.3/ext/ffi_c/gem_make.out
查了一下解决办法,上面找不到的文件mkmf
是ruby1.9.1-dev包的一部分,所以把它安装上就好。
sudo apt-get install ruby1.9.1-dev
接下来立即重试安装compass,成功。