2014-05-05 155 views
0

使用軟件包安裝來安裝perftools時出現錯誤。我得到:perftools上的軟件包安裝失敗

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
(I'm about to compile google-perftools.. this will definitely take a while) 
    -- tar zpxvf gperftools-2.0.tar.gz 
    -- patch -p1 < ../../../patches/perftools.patch 
    -- patch -p1 < ../../../patches/perftools-notests.patch 
    -- patch -p1 < ../../../patches/perftools-pprof.patch 
    -- patch -p1 < ../../../patches/perftools-gc.patch 
    -- patch -p1 < ../../../patches/perftools-debug.patch 
    -- patch -p1 < ../../../patches/perftools-objects.patch 
    -- patch -p1 < ../../../patches/perftools-frames.patch 
    -- patch -p1 < ../../../patches/perftools-realtime.patch 
    -- patch -p1 < ../../../patches/perftools-pause.patch 
    -- sed -i -e 's,SpinLock,ISpinLock,g' src/*.cc src/*.h src/base/*.cc src/base/*.h 
    -- ./configure --disable-heap-profiler --disable-heap-checker --disable-debugalloc --disable-shared 
    -- make 
checking for method.h... no 
checking for vm_core.h... no 
checking for method.h... no 
checking for vm_core.h... no 
checking for method.h... yes 
checking for vm_core.h... yes 
checking for iseq.h... no 


*************************************************************************************** 
****************** Debugger::RubyCoreSource::create_makefile FAILED ******************* 
*************************************************************************************** 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of necessary 
libraries and/or headers. Check the mkmf.log file for more details. You may 
need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --without-opt-dir 
    --with-opt-include 
    --without-opt-include=${opt-dir}/include 
    --with-opt-lib 
    --without-opt-lib=${opt-dir}/lib 
    --with-make-prog 
    --without-make-prog 
    --srcdir=. 
    --curdir 
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby 


Gem files will remain installed in /var/folders/j9/ghqqd20n13q5kjn2w0btg18m0000gn/T/bundler20140505-18890-1n58ssn/perftools.rb-2.0.1/gems/perftools.rb-2.0.1 for inspection. 
Results logged to /var/folders/j9/ghqqd20n13q5kjn2w0btg18m0000gn/T/bundler20140505-18890-1n58ssn/perftools.rb-2.0.1/gems/perftools.rb-2.0.1/ext/gem_make.out 
An error occurred while installing perftools.rb (2.0.1), and Bundler cannot continue. 
Make sure that `gem install perftools.rb -v '2.0.1'` succeeds before bundling. 

但是,當我做gem install perftools.rb -v '2.0.1'它的構建和正確安裝。

我使用ruby 2.0.0-p353,與rbenv 0.4.0。我正在使用海灣合作委員會版本4.2.1

我嘗試與紅寶石1.9.3捆綁安裝,並得到相同的錯誤。我應該怎麼做才能解決這個問題?

+0

它似乎不是一個Ruby問題,而是一個perftools編譯問題。 – aledalgrande

回答

0

你能發佈錯誤提到的mkmf.log文件嗎?在錯誤輸出中是否有其他有關丟失文件的錯誤?如果沒有捆綁器就可以正確安裝,也許bundler運行在不同的環境中(如果它存在,查看.bundle/config並比較ruby -v和bundle exec ruby​​ -v可能也有幫助)?

我遇到了類似的情況,試圖在Ubuntu 14.04上使用gcc v4.8.2,捆綁器版本1.7.4來設置一個使用此版本gem的項目。奇怪的是,在失敗之後再次運行bundle安裝對我來說很有效,但我沒有機會深入挖掘,找出原因。 :/

相關問題