安装Apache Thrift时gem扩展错误

时间:2016-08-01 01:37:37

标签: ruby makefile rubygems bundler thrift

我正在从源代码构建和安装Apache Thrift。当我运行make时,我收到有关Gem native的以下错误。我该如何处理这个gem原生扩展错误?

 Gem::Installer::ExtensionBuildError: 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:2:in `<main>'


Gem files will remain installed in /tmp/bundler20160731-25561-wpjc2k/eventmachine-1.2.0.1/gems/eventmachine-1.2.0.1 for inspection.
Results logged to /tmp/bundler20160731-25561-wpjc2k/eventmachine-1.2.0.1/gems/eventmachine-1.2.0.1/ext/gem_make.out
An error occurred while installing eventmachine (1.2.0.1), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.2.0.1'` succeeds before bundling.

1 个答案:

答案 0 :(得分:0)

Apache Thrift程序需要其他依赖项,其中一些在Apache Thrift安装要求中未明确提及。要修复此错误,请执行以下操作:

sudo apt-get install ruby-dev  

然后重试。我的操作系统是Ubuntu。