Aptana 3 ruby​​ 调试器 - DebugThread 循环中的异常:未定义的方法“is_binary_data?" [英] Aptana 3 ruby debugger - Exception in DebugThread loop: undefined method `is_binary_data?'

查看:35
本文介绍了Aptana 3 ruby​​ 调试器 - DebugThread 循环中的异常:未定义的方法“is_binary_data?"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Aptana 3 中调试简单的 ruby​​ 文件.

I'm trying to debug simple ruby file in Aptana 3.

class HelloWorld
  
def initialize()
    
end
  
def greet()
  puts "hello world"
end
end

h=HelloWorld.new
h.greet

断点设置为

h.greet

在我开始调试后,调试器启动,但是当它尝试初始化 ruby​​ 类时,调试器与消息断开连接

after I started debug, debugger starts, but when it tries to initialize ruby class, debugger disconnect with message

Fast Debugger (ruby-debug-ide 0.4.9) listens on :54749
Exception in DebugThread loop: undefined method `is_binary_data?' for "#<HelloWorld:0x85915fc>":String  

当我将断点设置为

h=HelloWorld.new

调试器启动,但在我进入 initialize() 构造函数后,它与之前的消息断开连接

debugger starts, but after I stepped into initialize() constructor, it disconnects with previous message

我的宝石清单:

*** LOCAL GEMS ***

archive-tar-minitar (0.5.2)
bigdecimal (1.1.0)
columnize (0.3.6)
io-console (0.3)
json (1.5.4)
linecache19 (0.5.13)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.4)
ruby-debug-base19 (0.11.26)
ruby-debug-ide19 (0.4.12)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5)

我已成功应用这些说明,解决调试问题,但我仍然收到此异常消息

I have successfully applied these instructions, to solve problems with debugging but I still got this exception message

欢迎任何能解决这个问题的答案.

Any answer is welcome which shed a light to this problem.

谢谢.

推荐答案

我的 ruby​​ 版本:

My ruby version:

ruby 1.9.3p0 (2011-10-30) [i386-mingw32]

我的宝石清单:

...
linecache19 (0.5.13)
ruby-debug-base19 (0.11.26)
ruby-debug-ide19 (0.4.12)
...

在 Aptana 3 中,我遇到了同样的错误.

In Aptana 3, I got same error.

Exception in DebugThread loop: undefined method `is_binary_data?' for "#<PostsController:0x65a8da8>":String

参见 ruby​​-debug-ide19-0.4.12/xml_printer.rb.

See ruby-debug-ide19-0.4.12 / xml_printer.rb .

  value_str = "[Binary Data]" if value_str.is_binary_data?
  print("<variable name=\"%s\" kind=\"%s\" value=\"%s\" type=\"%s\" hasChildren=\"%s\" objectId=\"%#+x\"/>",
      CGI.escapeHTML(name), kind, CGI.escapeHTML(value_str), value.class,
      has_children, value.respond_to?(:object_id) ? value.object_id : value.id)

参见 http://apidock.com/ruby/String/is_binary_data%3F.

String#is_binary_data?

String#is_binary_data?

此方法在最新的稳定版本中已弃用或移动.此处显示了最后一个现有版本 (v1_9_1_378).

This method is deprecated or moved on the latest stable version. The last existing version (v1_9_1_378) is shown here.

 def is_binary_data?
   ( self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" ) ) unless empty?
 end

将此代码添加到 xml_printer.rb(或您的代码).

Add this code to xml_printer.rb (or to your code).

class String
  def is_binary_data?
    ( self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" ) ) unless empty?
  end
end

谢谢.

这篇关于Aptana 3 ruby​​ 调试器 - DebugThread 循环中的异常:未定义的方法“is_binary_data?"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆