2016-08-01 116 views
0

我從源代碼構建和安裝Apache Thrift。當我運行make時,出現以下關於Gem native的錯誤。我該如何處理這個gem原生擴展錯誤?安裝Apache Thrift時使用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. 
+0

看起來你缺少ruby-dev庫。你在使用什麼平臺? Linux呢?達爾文? – avellable

+0

是的,我是。我安裝了ruby-dev,修復了錯誤。我在Linux上。 – nikk

+0

您能否請您寫一個答案,以便下次找解答的人可以看到答案? – avellable

回答

0

Apache Thrift程序需要額外的依賴項,其中一些未在Apache Thrift安裝需求中明確提及。要修復此錯誤,請執行:

sudo apt-get install ruby-dev 

然後重試。我的操作系統是Ubuntu。