为什么我的AptanaStudio3.0无法调试Rails应用程序?

时间:2012-02-23 14:43:21

标签: ruby-on-rails ruby ruby-debug

我这个问题已经谷歌了近一整天,但仍然没有回答。在Mac 10.6操作系统上,我的ruby版本是1.9.3,Rails是3.2.1。

现在我的宝石列表是:

linecache19 (0.5.13)
ruby-debug-base19 (0.11.26)
ruby-debug-ide19 (0.4.12)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5)

我认为我有我可能需要的所有东西,但是调试器仍然没有在我的AptanaStudio3上工作。

当我调试ruby程序时,我收到了这个错误:

Fast Debugger (ruby-debug-ide 0.4.9) listens on :51042
Exception in DebugThread loop: undefined method `is_binary_data?' for "Array (10 element(s))":String

当我调试rails服务器时,我收到了这个错误:

Fast Debugger (ruby-debug-ide 0.4.9) listens on :51175
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug19-0.11.6/cli/ruby-debug/interface.rb:128:in `<module:Debugger>'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug19-0.11.6/cli/ruby-debug/interface.rb:1:in `<top (required)>'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:1:in `require_relative'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug19-0.11.6/cli/ruby-debug/processor.rb:1:in `<top (required)>'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:6:in `require_relative'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:6:in `<top (required)>'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `each'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `block in require'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `each'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `require'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.22/lib/bundler.rb:122:in `require'
    /Users/Chris/workspace-aptana/RailsDemo/config/application.rb:7:in `<top (required)>'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:53:in `require'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:53:in `block in <top (required)>'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>'
    /Users/Chris/workspace-aptana/RailsDemo/script/rails:6:in `require'
    /Users/Chris/workspace-aptana/RailsDemo/script/rails:6:in `<top (required)>'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_load'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide19-0.4.12/lib/ruby-debug-ide.rb:123:in `debug_program'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide19-0.4.12/bin/rdebug-ide:87:in `<top (required)>'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/bin/rdebug-ide:19:in `load'
    /Users/Chris/.rvm/gems/ruby-1.9.3-p0/bin/rdebug-ide:19:in `<main>'
Uncaught exception: superclass mismatch for class RemoteInterface

任何人都可以提供帮助,非常感谢!

3 个答案:

答案 0 :(得分:3)

事实证明,ruby-debug-ide和ruby-debug19不能很好地解决名称空间问题。要在Aptana3上运行调试(我的特定版本是3.0.9),是从Gemfile中删除对ruby-debug19的引用并运行:

bundle install

确保它也从Gemfile.lock文件中删除。

希望这有帮助。

答案 1 :(得分:2)

在将我的Ubuntu 13.04系统从ruby 1.8.7升级到1.9.3之后,我也遇到了这个错误。这是我的解决方案......

  1. 从Gemfile中删除所有调试宝石。 (即没有ruby-debug-ide,ruby-debug-ide19,调试器等)运行bundle install。

  2. 从命令行运行gem install ruby​​-debug-ide,将gem安装到系统中。

  3. 注意:gem安装在系统中 - 这使得它可以被Aptana访问,但不能在捆绑中访问。

  4. Aptana调试工作正常。希望这会有所帮助。

答案 2 :(得分:0)

除了在Linux Fedora 16上运行相同版本时,我在标准透视图中添加“视图变量”(菜单:窗口/显示视图/其他/变量)时会出现相同的错误。

安装gem'ruby-debug-ide19'(0.4.12)之后,它可以正常工作。

我安装了这些宝石:

arcadia(0.11.1.1) archive-tar-minitar(0.5.2) 代码(1.0.5) 列(0.3.6) json(1.6.5) linecache19(0.5.13,0.5.12) minitest(2.11.3,2.5.1) 耙子(0.9.2.2) rdoc(3.12,3.9.4) ruby-debug-base19(0.11.26,0.11.25) ruby-debug-ide(0.4.16) ruby-debug-ide19(0.4.12) ruby-debug19(0.11.6) ruby_core_source(0.1.5) rubygems-update(1.8.18)

希望这个帮助