5

我设置了一个全新的 Ubuntu 安装并按照本指南安装 RVM、Ruby 1.9.2 和 Rails 3。

然后我安装了 RubyMine 3.0,它自动从 RVM 路径检测到 Ruby 1.9.2 SDK,所以没关系。我可以完美地启动服务器(绿色播放按钮)。

现在的问题是我无法调试它,因为它在启动后会引发以下异常。

/home/eparizzi/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug-ide-0.4.16/bin/rdebug-ide --port 39879 -- /home/eparizzi/Projects/Delko/src/script/rails server -p 3000 -b 0.0.0.0 -e development
Fast Debugger (ruby-debug-ide 0.4.16, ruby-debug-base 0.11) listens on 127.0.0.1:39879
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug19-0.11.6/cli/ruby-debug/interface.rb:128:in `<module:Debugger>'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug19-0.11.6/cli/ruby-debug/interface.rb:1:in `<top (required)>'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:1:in `require_relative'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:1:in `<top (required)>'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:6:in `require_relative'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:6:in `<top (required)>'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `require'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `each'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:66:in `block in require'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `each'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler/runtime.rb:55:in `require'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.10/lib/bundler.rb:120:in `require'
    /home/eparizzi/Projects/Delko/src/config/application.rb:7:in `<top (required)>'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:28:in `require'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:28:in `block in <top (required)>'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in `tap'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.0.5/lib/rails/commands.rb:27:in `<top (required)>'
    /home/eparizzi/Projects/Delko/src/script/rails:6:in `require'
    /home/eparizzi/Projects/Delko/src/script/rails:6:in `<top (required)>'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_load'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug-ide-0.4.16/lib/ruby-debug-ide.rb:112:in `debug_program'
    /home/eparizzi/.rvm/gems/ruby-1.9.2-p180/gems/ruby-debug-ide-0.4.16/bin/rdebug-ide:87:in `<top (required)>'
    -e:1:in `load'
    -e:1:in `<main>'
Uncaught exception: superclass mismatch for class RemoteInterface

Process finished with exit code 0

我在 .Gemfile 中有以下行

gem 'ruby-debug19', :require => 'ruby-debug'

另外(在一些博客之后)我安装了 ruby​​-debug-ide gem,如下所示:

gem install ruby-debug-ide19 -- --with-ruby-include=$rvm_path/src/ruby-1.9.2-p180/ 
4

2 回答 2

6

这绝对是与 gem 相关的调试问题。不过,您不需要在 .gemfile 中包含调试 gem。Rubymine 应该会自动拾取它,所以我会从那里删除它。

确保你已经为 1.9 安装了基于调试的 gem

gem install ruby-debug-base19

我记得一开始有几个与 1.9 的调试有关的问题,但我认为现在已经解决了。

你看过这篇文章了吗?它还可以帮助您指明方向。

在 ruby​​ 1.9 中调试

祝一切顺利。

于 2011-03-16T22:12:31.017 回答
2

从您的 Gemfile 中删除 :require => 'ruby-debug' ,它应该可以工作。

于 2012-02-08T23:32:50.553 回答