Ruby-debug not working

佐手、 提交于 2019-11-28 00:25:37

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

Visionscaper

I had the same issues (and more) to get ruby debugging working in Aptana Studio 3. My setup and procedure to make it work:

  • Mac OS X Lion 10.7.2
  • Aptana Studio 3 (Build 3.0.8.201201201658)
  • Using rvm, in my project working directory I have a .rvmrc stating:

    rvm use ruby-1.9.3-p0@mygemset
    

To make ruby debugging work in Aptana Studio I now have the following setup

  • At the end of my Gemfile I have:

    gem "ruby-debug-base19x", "0.11.30.pre10"
    gem 'ruby-debug-ide'
    

Note that I'm NOT using ruby-debug-ide19 and ruby-debug19, Aptana Studio simply refused to use this gem. No matter what, it always picked ruby-debug-ide 0.4.16.

I'm also not using ruby-debug-base19, but ruby-debug-base19x.

  • To build the latest ruby-debug-base19x, be sure the specify the correct ruby context (include):

    rvm 1.9.3-p0@mygemset do gem install --pre ruby-debug-base19x -- --with-ruby-include=/Users/Freddy/.rvm/src/ruby-1.9.3-p0
    

Lose the rvm ... do when not using rvm.

  • Don't forget to do Bundle install (or bundle update) from your project working directory. In my terminal, when I type'Bundle list', for the mentioned gems the following versions are listed:

    linecache19 (0.5.13)
    ruby-debug-base19x (0.11.30.pre10)
    ruby-debug-ide (0.4.16)
    
  • Important : if you have linecache19 version 0.5.12 instead of .13, download the latest version from RubyForge: ruby-debug19: Project Filelist. I Downloaded it to my ~/Downloads folder, so building and installing this gem in my rvm context is as follows:

    rvm 1.9.3-p0@mygemset do gem install ~/Downloads/linecache19-0.5.13.gem -- --with-ruby-include=/Users/Freddy/.rvm/src/ruby-1.9.3-p0
    

If you needed to install linecache19 version 0.5.13, don't forget to run 'bundle update' again.

  • After all this the final issue I had (and its solution) when running the debugger in the ide is described here:

Aptana 3 ruby debugger - Exception in DebugThread loop: undefined method `is_binary_data?'

Put the code provided in the first answer above the 'module Debugger' statement in xml_printer.rb.

Enjoy!

-- Freddy

A note on building ruby-1.9.3-p0. This is a bit out of the scope of the question, but since building this was (also) a pain a hint here. Compiling ruby-1.9.3.-p0 gave multiple compiler errors related to openssl. The best thing to do is to install the openssl-0.9.8n package in the rvm environment:

  • When you have XCode 4.2 installed, first you need to put the following in your .rvmrc or .profile :

    export CC=/usr/bin/gcc-4.2
    

Don't for get to enabled it, e.g. $ source ~/.rvmrc

The answer's already in your Gemfile, I think.

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

ruby-debug is broken. There is a new fork of the project that works that is now becoming widely used. It's the same code, just fixed. This new version is now the one used on the core ruby on rails project.

Here's the new gem: https://github.com/cldwalker/debugger

To use it just include it in your gem file

gem 'debugger'

Here's a link to the commit where it was pulled into rails:

https://github.com/matschaffer/knife-solo/pull/38

What made it work for me is:

sudo gem install ruby-debug19
gem install linecache19
gem install ruby-debug-base19
bundle update
rails server -u

here is my soultion . I followed this post with no success. :(

I added the below gem to my Gemfile and ==>> run $bundle install ...worked

=added to Gemfile=> gem 'ruby-debug-ide', '~> 0.4.22'

Installing ruby-debug-ide 0.4.22
Using sass 3.2.19
Using sass-rails 4.0.3
Using sdoc 0.4.0
Using spring 1.1.3
Using sqlite3 1.3.9
Using turbolinks 2.2.2
Using uglifier 2.5.1
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
-SVE1411EGXB:~/Desktop/myapp$ 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!