2010-11-15 24 views
14

我已經搜索了高和低的解決方案。我安裝了linecache19ruby_core_sourceruby​​-debug不會安裝/構建本機擴展

無論這些命令都可以工作:

gem install ruby-debug19 
gem install ruby-debug19 -- --with-ruby-include=/Users/benjohnson/.rvm/src/ruby-1.9.1-p378 

這裏是我不斷收到錯誤:

Building native extensions. This could take a while... 
ERROR: Error installing ruby-debug19: 
ERROR: Failed to build gem native extension. 

/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/bin/ruby extconf.rb 
checking for rb_method_entry_t.body in method.h... no 
checking for vm_core.h... no 
checking for rb_method_entry_t.body in method.h... no 
checking for vm_core.h... yes 
checking for iseq.h... yes 
checking for insns.inc... yes 
checking for insns_info.inc... yes 
checking for eval_intern.h... yes 
creating Makefile 

make 
gcc -I. -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/i386-darwin10.4.0 -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby/backward -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1 -I. -DHAVE_VM_CORE_H -DHAVE_ISEQ_H -DHAVE_INSNS_INC -DHAVE_INSNS_INFO_INC -DHAVE_EVAL_INTERN_H -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby-1.9.1-p378 -fno-common -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common -o breakpoint.o -c breakpoint.c 
gcc -I. -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/i386-darwin10.4.0 -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby/backward -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1 -I. -DHAVE_VM_CORE_H -DHAVE_ISEQ_H -DHAVE_INSNS_INC -DHAVE_INSNS_INFO_INC -DHAVE_EVAL_INTERN_H -I/Users/benjohnson/.rvm/rubies/ruby-1.9.1-p378/include/ruby-1.9.1/ruby-1.9.1-p378 -fno-common -O2 -g -Wall -Wno-parentheses -fno-common -pipe -fno-common -o ruby_debug.o -c ruby_debug.c 
ruby_debug.c: In function ‘ruby_method_ptr’: 
ruby_debug.c:141: error: ‘rb_method_entry_t’ undeclared (first use in this function) 
ruby_debug.c:141: error: (Each undeclared identifier is reported only once 
ruby_debug.c:141: error: for each function it appears in.) 
ruby_debug.c:141: error: ‘method’ undeclared (first use in this function) 
ruby_debug.c:142: warning: implicit declaration of function ‘rb_method_entry’ 
ruby_debug.c: In function ‘debug_event_hook’: 
ruby_debug.c:719: error: ‘rb_method_entry_t’ undeclared (first use in this function) 
ruby_debug.c:719: error: ‘me’ undeclared (first use in this function) 
make: *** [ruby_debug.o] Error 1 


Gem files will remain installed in /Users/benjohnson/.rvm/gems/ruby-1.9.1-p378/gems/ruby-debug-base19-0.11.24 for inspection. 
Results logged to /Users/benjohnson/.rvm/gems/ruby-1.9.1-p378/gems/ruby-debug-base19-0.11.24/ext/ruby_debug/gem_make.out 

任何想法?我迷路了。謝謝。

+0

是否'/Users/benjohnson/.rvm/gems/ruby-1.9.1-p378/gems/ruby-debug-base19-0.11.24/ext/ruby_debug/ gem_make.out'包含任何尚未輸出到stdout的附加信息? – 2010-11-15 00:29:28

+0

不是,與上面相同的確切錯誤消息。沒有額外的。 – 2010-11-16 20:07:01

+0

我有完全相同的問題。會很高興的任何幫助! – bastibe 2010-11-24 10:31:53

回答

6

我有同樣的問題(在1.9.1和1.9.2)。即使試圖安裝0.11.23觸發了錯誤。我發現,這是必要的:

  • 卸載寶石(所有版本對我來說):

    gem uninstall ruby-debug-base19

  • 刪除0.11.24目錄(在我的情況:〜/ .rvm /gems/ruby-1.9.2-p0/gems/ruby-debug-base19-0.11.24/)

  • 安裝0.11.23明確:

    gem install ruby-debug-base19 --version=0.11.23

這是我得到了大部分的解決方案:http://rails.brentsowers.com/2010_08_01_archive.html

此外,如果您使用捆紮機:

我有問題,直到我升級到最新的捆紮機(1.0.2 => 1.0。 7),因爲它堅持要安裝ruby-debug-base19 v 0.11.24)。

在你的Gemfile,確保你已經固定紅寶石調試base19的版本:和

gem "ruby-debug-base19", "0.11.23", :require => nil

+2

這仍然是一個問題? – aceofspades 2011-04-29 00:35:02

1

你已經安裝GCC路徑在PATH環境變量gcc.exe引用? 這爲我解決了類似的問題,這可能也是你的解決方案!

1

紅寶石我與我的工作的版本,不得不這兩行

gem 'ruby-debug-base19', '0.11.23' 

gem "ruby-debug19" 
2

在Debian/Ubuntu的/薄荷這一問題可以通過安裝這些工具包來解決(我添加到我的Gemfile不敢肯定這是造成問題)

的apt-get安裝libcurl4-的OpenSSL開發中的libgcrypt11-dev的libgnutls-dev的 libidn11-的libldap2開發-dev的librtmp-dev的上libtasn1-3-dev的M4

+0

此限制集也適用於我:'apt-get install libcurl4-openssl-dev libgcrypt11-dev libgnutls-dev libidn11-dev libldap2-dev librtmp-dev libtasn1-3-dev m4' – mrks 2013-04-05 15:38:53

+0

謝謝,我已經編輯了答案 – Tombart 2013-04-05 16:41:47

4

這一個最適合我的,因爲它不會顯得太hackish的:

gem install ruby-debug19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-head/ 

不要忘記設置$ rvm_path。 在我的情況下,最後一個文件夾是ruby-1.9.3-head--爲你挑選合適的文件夾。

了從這裏這樣的回答:ruby-debug install error: failed to build gem native extension

+0

+1這一個工作...只是確保使用正確的ruby目錄..在我的情況下是'$ rvm_path/src/ruby​​-1.9.3-p448 /' – Orlando 2013-11-19 18:42:06

相關問題