红宝石宝石指南针安装错误

时间:2016-12-01 11:19:43

标签: ruby-on-rails ruby rubygems compass

我正在尝试安装gem compass,但在运行sudo gem install compass时出现以下错误

Fetching: sass-3.4.22.gem (100%)
Fetching: multi_json-1.12.1.gem (100%)
Fetching: compass-core-1.0.3.gem (100%)
Fetching: compass-import-once-1.0.5.gem (100%)
Fetching: chunky_png-1.3.8.gem (100%)
Fetching: rb-fsevent-0.9.8.gem (100%)
Fetching: ffi-1.9.14.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.14 for inspection.

结果记录到/var/lib/gems/1.9.1/gems/ffi-1.9.14/ext/ffi_c/gem_make.out

我的宝石版本是1.8.23

1 个答案:

答案 0 :(得分:0)

请先试试。

xcode-select --install
sudo gem update --system
sudo gem install compass

如果这不起作用,那么

sudo apt-get remove ruby
apt-get autoremove
sudo apt-get install ruby2.2(Change from your ruby version)
sudo gem install compass