2012-06-17 102 views
17

當我嘗試安裝ruby-debug-base19x gem來調試使用RubyMine IDE的應用程序時,我收到了下面的錯誤消息,任何人都可以幫助我嗎?無法安裝ruby-debug-base19x gem

我使用的是Mac OS X 10.7.4

/Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for rb_method_entry_t.body in method.h... no 
checking for vm_core.h... no 
/Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config. 
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 
compiling breakpoint.c 
compiling ruby_debug.c 
ruby_debug.c:24: error: conflicting types for ‘rb_iseq_compile_with_option’ 
/Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby-1.9.3-p194/vm_core.h:505: error: previous declaration of ‘rb_iseq_compile_with_option’ was here 
ruby_debug.c: In function ‘call_at_line_unprotected’: 
ruby_debug.c:474: warning: implicit conversion shortens 64-bit value into a 32-bit value 
ruby_debug.c: In function ‘filename_cmp’: 
ruby_debug.c:538: warning: implicit conversion shortens 64-bit value into a 32-bit value 
ruby_debug.c:539: warning: implicit conversion shortens 64-bit value into a 32-bit value 
ruby_debug.c: In function ‘optional_frame_position’: 
ruby_debug.c:1695: warning: implicit conversion shortens 64-bit value into a 32-bit value 
ruby_debug.c: In function ‘do_jump’: 
ruby_debug.c:2310: warning: implicit conversion shortens 64-bit value into a 32-bit value 
ruby_debug.c: In function ‘context_jump’: 
ruby_debug.c:2378: warning: comparison between signed and unsigned 
ruby_debug.c:2392: warning: comparison between signed and unsigned 
make: *** [ruby_debug.o] Error 1 

編輯

當我嘗試安裝使用 「的RubyMine寶石工具」(RubyMine的IDE內)的寶石,我收到了消息如下:

Error running Development: myproject: Failed to Install Gems. Following gems were not installed: /Applications/RubyMine.app/rb/gems/ruby-debug-base19x-0.11.30.pre10.gem: Error installing ruby-debug-base19x-0.11.30.pre10.gem: ERROR: Failed to build gem native extension. /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/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 --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/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/bin/ruby --with-ruby-dir --without-ruby-dir --with-ruby-include --without-ruby-include=${ruby-dir}/include --with-ruby-lib --without-ruby-lib=${ruby-dir}/lib /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/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/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in block in try_compile' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:443:in with_werror' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:491:in try_compile' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:1002:in block in have_struct_member' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in block in checking_for' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in block (2 levels) in postpone' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in open' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in block in postpone' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in open' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in postpone' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in checking_for' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:1001:in have_struct_member' from extconf.rb:6:in block in ' from extconf.rb:31:in call' from extconf.rb:31:in block in ' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:527:in with_cppflags' from extconf.rb:30:in ' Gem files will remain installed in /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19x-0.11.30.pre10 for inspection. Results logged to /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19x-0.11.30.pre10/ext/ruby_debug/gem_make.out /Users/danilobarsotti/Library/Preferences/RubyMine40/rb/linecache19-0.5.13.gem: Error installing linecache19-0.5.13.gem: ERROR: Failed to build gem native extension. /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for vm_core.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 --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/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/bin/ruby --with-ruby-dir --without-ruby-dir --with-ruby-include --without-ruby-include=${ruby-dir}/include --with-ruby-lib --without-ruby-lib=${ruby-dir}/lib /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/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/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:506:in try_cpp' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:931:in block in have_header' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:790:in block in checking_for' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in block (2 levels) in postpone' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in open' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:284:in block in postpone' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:254:in open' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in postpone' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in checking_for' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:930:in have_header' from extconf.rb:15:in block in ' from /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in call' from /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in create_makefile_with_core' from extconf.rb:19:in ` ' Gem files will remain installed in /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/linecache19-0.5.13 for inspection. Results logged to /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/linecache19-0.5.13/ext/trace_nums/gem_make.out

回答

19

1)嘗試下載linecache19-0.5.13.gem和紅寶石調試base19-0.11.26.gem從http://rubyforge.org/frs/?group_id=8883

2)創業板安裝linecache19-0.5.13.gem

3)寶石安裝紅寶石調試base19-0.11.26.gem - --with-紅寶石包括= [您紅寶石源] 或者你可以嘗試寶石安裝紅寶石調試base19x - 事先

+1

我下載了linecache19-0.5.13.gem並安裝,然後我執行了gem install ruby​​-debug-base19x --pre,現在一切正常,RubyMine正在完美地調試我的代碼! !謝謝!!我真的很感謝你的幫助!!!! – danilodeveloper

+0

感謝stackoverflow! – odiszapc

+0

太棒了!我已經在另一個問題上摸索了很長時間了。謝謝!+1 – janechii

4

您可以嘗試

gem install ruby-debug-ide19 

(根據wiki)。這在我的OS X 10.7.4上安裝,但你可能想給debugger寶石一個鏡頭(gem install debugger)。它實際上保持了,不像大多數ruby-debug * gems。

+0

沒有同樣的問題的工作,仍然:(,我編輯我的問題,幷包含更多信息TKS – danilodeveloper

+0

這個工作在Mac OS X山獅10.8.2 –

+0

+ 1,這爲我節省了很多痛苦 –

3

剛從你的gem/gemset中刪除所有調試相關的gem,然後讓RubyMine重新安裝正確的。爲我工作。

+0

這也適用於我,當我跑「寶石聯合國」安裝linecache19「我根據它發現了其他ruby-debug版本。 –

1

@ gamov的解決方案爲我工作,只要讓RubyMine安裝調試所需的所有寶石。

如果您自行安裝所有寶石,確保版本正確非常重要。

不管怎麼說,這是真的需要的RubyMine調試我的代碼寶石列表:

寶石列表

  • 的BigDecimal(1.1.0)
  • 調試器ruby_core_source(1.2。 3)
  • IO-控制檯(0.3)
  • JSON(1.5.5)
  • MINITEST 2.5.1)
  • 耙(0.9.2.2)
  • 的RDoc(3.9.5)
  • 紅寶石調試base19x(0.11.30.pre12)
  • 紅寶石調試-IDE 0.4.17)

希望這會有所幫助,並希望更多的人不必訴諸於我們過去一直在做的舊方式。

請確保在嘗試使用RubyMine進行調試之前安裝DevKit。 您應該能夠從ruby安裝程序頁面獲取DevKit(注意:不同的DevKit版本可用於不同的ruby版本) 提取DevKit Zip文件並在您已經提取DevKit的目錄中執行以下操作: ' Ruby dk.rb init' 'Ruby dk.rb install'

+0

Tks!所以如果這個問題幫助你,請注意。 ;) – danilodeveloper

+0

我希望我能投票的問題,但我是新來的!在我開始做這件事之前需要更多的分數......:C –

0

我有一個不同的問題,它阻止我安裝ruby-debug-base19x,但導致比danilodeveloper有不同的具體錯誤。在這裏提到它,因爲那些有我的問題的人可能會首先發現這個問題:

RubyMine 5.4.3.2.1 [愛那個版本號]安裝了一個版本太舊的debugger-ruby_core_source gem(1.1.9)對於ruby-debug-base19x(0.11.30.pre12)和/或我正在使用的ruby(1.9.3-p484)。解決的辦法是

gem update debugger-ruby_core_source 

(其推向1.3.2),並讓RubyMine的嘗試重新安裝紅寶石調試base19x,它成功了。

0

我在rubymine中設置了錯誤的ruby版本;在菜單欄中進入「Rubymine」 - >「preferences」 - >「Ruby SDK and Gems」,並確保它指向您期待的Ruby版本。

發現這個想法在這裏:!https://stackoverflow.com/a/21056201/1462575