Aptana 3 ruby debugger - Exception in DebugThread loop: undefined method `is_binary_data?'
My ruby version:
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]
My gems list:
...
linecache19 (0.5.13)
ruby-debug-base19 (0.11.26)
ruby-debug-ide19 (0.4.12)
...
In Aptana 3, I got same error.
Exception in DebugThread loop: undefined method `is_binary_data?' for "#<PostsController:0x65a8da8>":String
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)
See http://apidock.com/ruby/String/is_binary_data%3F .
String#is_binary_data?
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
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
Thank you.
Ruby-debug not working
Make sure you have gem "ruby-debug19", :require => 'ruby-debug'
in your Gemfile, then run bundle install
:)
Edit: Added the important :require =>
statement, which I missed before
Why my AptanaStudio3.0 can't debug Rails application?
It turns out that ruby-debug-ide and ruby-debug19 don't play well, something about conflicting name-space issues. To get debugging to work on Aptana3 (my specific version is 3.0.9), is to remove references to ruby-debug19 from you Gemfile and run:
bundle install
to make sure it's also removed from the Gemfile.lock file.
Hope this helps.
debugging a rails app with rubymine
You have ruby-debug
gem installed, remove it.
See this answer, only 2 debug gems are needed (versions will be different for Ruby 1.8):
ruby-debug-base (0.10.5.rc3)
ruby-debug-ide (0.4.17.beta16)
Related Topics
Pg Error Could Not Connect to Server: Connection Refused Is the Server Running on Port 5432
How to Get a List of Files That Have Been 'Required' in Ruby
Rails 4.1 Can't Deploy via Capistrano 3
Missing a Template for This Request Format and Variant
Rails: How to Get a File Extension/Postfix Based on the Mime Type
No Such File to Load Bundler Error for Rails 3
Capistrano 3 Execute Within a Directory
Scientific Programming with Ruby
Retrieve Contents of Url as String
Normalizing Line Endings in Ruby
<Rubygems> How to Change Gem Environment Settings
Customize Error Message with Simple_Form