Ruby Compass ERROR: Failed to build gem native extension

Ruby Compass ERROR: Failed to build gem native extension

您好,我是 运行 Ubuntu 15.04,我正在尝试安装 Compass gem。我按照 Compass 网站告诉我的那样进行了 gem 更新。然后我尝试安装 Compass 并收到以下错误。

Building native extensions.  This could take a while...
ERROR:  Error installing compass:
ERROR: Failed to build gem native extension.

/usr/bin/ruby2.1 -r ./siteconf20150609-16406-5iavn8.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/ffi-1.9.8 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86-linux/2.1.0/ffi-1.9.8/gem_make.out

这是 gem_make.out 文件的输出

/usr/bin/ruby2.1 -r ./siteconf20150609-16446-49gin0.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

现在不确定要做什么。谢谢!

mkmf.rb can't find header files for ruby at

您需要 ruby 开发头文件来编译 gems。

您需要 ruby2.1-dev.

您可能还需要其他软件包,例如 build-essential

尝试以下操作:

sudo apt-get install ruby2.1-dev build-essential

在 Ubuntu 的早期版本(例如 14.04)上,您将需要 ruby2.0-dev 软件包。

sudo apt-get install ruby2.0-dev build-essential