在perftools上捆绑安装失败

时间:2014-05-05 17:55:57

标签: ruby-on-rails ruby bundler

使用bundle install安装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。我正在使用gcc版本4.2.1

我尝试使用ruby 1.9.3进行捆绑安装并得到相同的错误。我该怎么做才能解决这个问题?

1 个答案:

答案 0 :(得分:0)

你能发布错误提到的mkmf.log文件吗?有关错误输出中丢失文件的任何其他错误?如果它在没有bundler的情况下正确安装,也许bundler在不同的环境中运行(如果它存在则查看.bundle / config并且比较ruby -v和bundle exec ruby​​ -v也可能有用)?

我遇到类似的尝试设置一个项目,该项目在Ubuntu 14.04上使用相同的ruby版本,使用gcc v4.8.2,bundler版本1.7.4,使用此版本的gem。奇怪的是,在我失败后再次运行bundle install,但我没有机会深入挖掘以找出原因。 :/