LoginSignup
1
2

More than 5 years have passed since last update.

Aptana Studio 3 でデバッグするためのパッチ

Last updated at Posted at 2012-11-26

環境

$ ruby -v
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.4.0]

問題

ruby-debug-ide gem の中で以下のような

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

のような例外が発生してサーバプロセスが終了してしまう。

原因はruby-debug-idexml_printer.rbのコード中にでdeprecated なメソッドである String#is_binary_data?を使用しているため。

回避策

config/environments/development.rb に以下のようなコードを追加

  # patch for Debugger
  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 debugger - Exception in DebugThread loop: undefined method `is_binary_data?'

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2