17

当我尝试安装 ruby​​-debug-base19x gem 以使用 RubyMine IDE 调试我的应用程序时,我收到以下错误消息,有人可以帮助我吗?

我正在使用 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。未安装以下 gem:/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 检查 rb_method_entry_t.called_id 在 method.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/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' 来自 /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 block in checks_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 open' 来自 /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' 来自 /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:280:in checks_for postpone' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in ' 来自 / 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:inblock in '来自 extconf.rb:31:in call' from extconf.rb:31:inblock 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/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' 来自 /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 阻止从 /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' 来自 /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' 来自 /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9 .1/mkmf.rb:280:in checks_for postpone' from /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:789:in ' 来自 /Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:930:in have_header' from extconf.rb:15:inblock in '来自/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 文件将继续安装在 /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

4

6 回答 6

19

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

2) 宝石安装 linecache19-0.5.13.gem

3) gem install ruby​​-debug-base19-0.11.26.gem -- --with-ruby-include=[your ruby​​ source] 或者你可以试试gem install ruby​​-debug-base19x --pre

于 2012-06-18T00:42:19.393 回答
4

你可以试试

gem install ruby-debug-ide19

(根据维基)。这在 OS X 10.7.4 上为我安装,但您可能想试一试调试器gem ( gem install debugger)。与大多数 ruby​​-debug* gem 不同,它实际上得到了维护。

于 2012-06-17T23:06:52.497 回答
3

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

于 2013-01-02T09:06:32.890 回答
1

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

如果您自己安装所有 gem,确保版本正确很重要。

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

宝石清单

  • 大十进制 (1.1.0)
  • 调试器-ruby_core_source (1.2.3)
  • io 控制台 (0.3)
  • json (1.5.5)
  • 小测试 2.5.1)
  • 耙子 (0.9.2.2)
  • rdoc (3.9.5)
  • ruby-debug-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 安装'

于 2013-09-22T15:37:08.040 回答
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,它成功了。

于 2014-04-25T11:14:24.237 回答
0

我在 ruby​​mine 中设置了错误的 ruby​​ 版本;在菜单栏中转到“Rubymine”->“preferences”->“Ruby SDK and Gems”并确保它指向您期望的 Ruby 版本。

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

于 2014-07-23T21:25:44.643 回答