2013-06-27 126 views
0

我不太清楚爲什麼,但我似乎無法安裝任何涉及構建本機擴展的寶石。任何人都可以建議如何開始調試這個問題?這裏的輸出我得到gem install debugger無法構建寶石原生擴展

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

     /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb 
checking for rb_method_entry_t.called_id in method.h... *** 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=/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby 
    --with-ruby-dir 
    --without-ruby-dir 
    --with-ruby-include=${ruby-dir}/include 
    --with-ruby-lib 
    --without-ruby-lib=${ruby-dir}/lib 
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError) 
You have to install development tools first. 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1002:in `block in have_struct_member' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' 
    from /Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1001:in `have_struct_member' 
    from extconf.rb:34:in `block in <main>' 
    from /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-ruby_core_source-1.2.3/lib/debugger/ruby_core_source.rb:21:in `call' 
    from /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-ruby_core_source-1.2.3/lib/debugger/ruby_core_source.rb:21:in `create_makefile_with_core' 
    from extconf.rb:87:in `<main>' 


Gem files will remain installed in /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0 for inspection. 
Results logged to /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0/ext/ruby_debug/gem_make.out 
An error occurred while installing debugger (1.6.0), and Bundler cannot continue. 

另外,我最近重新安裝自制軟件,因此這可能是問題?我肯定已經安裝了XCode Developre工具。

這裏的mkmf.log的內容:

○ cat /Users/Chintan/.rvm/gems/ruby-1.9.3-p0/gems/debugger-1.6.0/ext/ruby_debug/mkmf.log 
"/usr/local/bin/gcc-4.2 -o conftest -I/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/x86_64-darwin12.2.1 -I/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1/ruby/backward -I/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/include/ruby-1.9.1 -I. -I/Users/Chintan/.rvm/src/ruby-1.9.3-p0 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -I/Users/Chintan/.rvm/usr/include -fno-common -pipe conftest.c -L. -L/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib -L. -L/Users/Chintan/.rvm/usr/lib  -lruby.1.9.1 -lpthread -ldl -lobjc " 
/Users/Chintan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:317: warning: Insecure world writable dir /usr/local/heroku/bin in PATH, mode 040777 
checked program was: 
/* begin */ 
1: #include "ruby.h" 
2: 
3: int main() {return 0;} 
/* end */ 
+0

你安裝的Xcode命令行工具?他們在你的道路上嗎? – Doon

+0

他們肯定是安裝的。我將如何檢查他們是否在我的道路上? – chintanparikh

+0

請注意mkmf.log的內容? (在你的路徑中是gcc?你可以通過運行$ which gcc來檢查) – rogerdpack

回答

0

這爲我工作:

gem update debugger-ruby_core_source 
相關問題