首页 > Ruby/Rails开发 > 安装compass时出现ERROR: Failed to build gem native extension…… — mkmf (Load Error)解决办法

安装compass时出现ERROR: Failed to build gem native extension…… — mkmf (Load Error)解决办法

2015年11月11日

安装compass时出现ERROR: Failed to build gem native extension…… — mkmf (Load Error)解决办法

http://www.phperz.com/article/14/1227/43370.html

安装compass时出现ERROR: Failed to build gem native extension…… — mkmf (Load Error)解决办法 – PHPERZ中文资讯站

本文为大家讲解的是安装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,成功。

分类: Ruby/Rails开发 标签:
本文的评论功能被关闭了.