无法安装ruby-debug-base19x gem

时间:2012-06-17 21:08:25

标签: ruby-on-rails ruby debugging

当我尝试使用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 Gem Tools”(在RubyMine IDE中)安装gem时,我收到以下消息:

  

运行开发时出错:myproject:无法安装Gems。   未安装以下宝石:   /Applications/RubyMine.app/rb/gems/ruby-debug-base19x-0.11.30.pre10.gem:   安装ruby-debug-base19x-0.11.30.pre10.gem时出错:错误:失败   构建gem原生扩展。   /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb   检查method.h中的rb_method_entry_t.called_id ... * extconf.rb   失败* 由于某种原因无法创建Makefile,可能是缺乏   必要的库和/或标题。检查mkmf.log文件   更多细节。您可能需要配置选项。提供   配置选项: - 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 /红宝石/ 1.9.1 / mkmf.rb:381:在   来自try_compile的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 阻止   /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'   /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 阻止来自check_for'   /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 打开'来自   /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 打开'来自   /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 来自check_for'   /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阻止'来自   extconf.rb:31:在{来自call' from extconf.rb:31:in块中   /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文件将保留   安装在   /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby-debug-base19x-0.11.30.pre10   检查。记录结果   /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:   安装linecache19-0.5.13.gem时出错:错误:无法构建gem   原生扩展。   /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb   检查vm_core.h ... * extconf.rb失败* 无法创建   Makefile由于某种原因,可能缺少必要的库   和/或标题。检查mkmf.log文件以获取更多详细信息。你可能需要   配置选项。提供配置选项: - 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 /红宝石/ 1.9.1 / mkmf.rb:381:在   来自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'   /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 阻止来自check_for'   /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 打开'来自   /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 打开'来自   /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 来自check_for'   /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阻止'来自   /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:18:in   来自extconf.rb的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':19:''Gem files will   仍然安装在   /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/linecache19-0.5.13   检查。记录结果   /Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/linecache19-0.5.13/ext/trace_nums/gem_make.out

6 个答案:

答案 0 :(得分:19)

1)尝试从http://rubyforge.org/frs/?group_id=8883下载linecache19-0.5.13.gem和ruby-debug-base19-0.11.26.gem

2)gem install linecache19-0.5.13.gem

3)gem install ruby​​-debug-base19-0.11.26.gem - --with-ruby-include = [你的红宝石来源]   或者您可以尝试 gem install ruby​​-debug-base19x --pre

答案 1 :(得分:4)

你可以尝试

gem install ruby-debug-ide19

(根据wiki)。这是在OS X 10.7.4上为我安装的,但是你可能想要给debugger gem一个镜头(gem install debugger)。它实际上是维护的,不像大多数ruby-debug * gems。

答案 2 :(得分:3)

只需从gems / gemset中删除所有与调试相关的gem,然后让RubyMine重新安装正确的gem。为我工作。

答案 3 :(得分:1)

@ gamov的解决方案对我有用,让RubyMine安装调试所需的所有宝石。

如果您自己安装所有宝石,请务必确保版本正确。

无论如何,这里是RubyMine调试我的代码真正需要的宝石列表:

宝石清单

  • bigdecimal(1.1.0)
  • debugger-ruby_core_source(1.2.3)
  • io-console(0.3)
  • json(1.5.5)
  • minitest 2.5.1)
  • rake(0.9.2.2)
  • rdoc(3.9.5)
  • ruby​​-debug-base19x(0.11.30.pre12)
  • ruby​​-debug-ide 0.4.17)

希望这会有所帮助,并希望更多的人不必采用过去我们过去做过的旧方式。

请确保在尝试使用RubyMine进行调试之前安装DevKit。 您应该能够从ruby安装程序页面获取DevKit(注意:不同的DevKit版本可用于不同的ruby版本) 解压缩DevKit Zip文件,并在将DevKit解压缩到的目录中执行以下操作: 'Ruby dk.rb init' 'Ruby dk.rb install'

答案 4 :(得分: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)和/或我使用的红宝石(1.9.3-p484)。解决方案是

gem update debugger-ruby_core_source

(将其带到1.3.2)并让RubyMine再次尝试安装ruby-debug-base19x,这已成功。

答案 5 :(得分:0)

我在rubymine中设置了错误的ruby版本;在菜单栏中转到" Rubymine" - > "偏好" - > " Ruby SDK和Gems"并确保它指向您期望的Ruby版本。

在此处找到了这个想法:https://stackoverflow.com/a/21056201/1462575