Rails with ruby-debugger throw 'Symbol not found: _ruby_current_thread (LoadError)'

Solution 1:

UPDATE:

Looks like you only need to put this in your gemfile:

gem "debugger"

and now works.

Old article follows

====================================

Jerome is correct, but lacking in the details. Here is the blow by blow, taken from this https://gist.github.com/1331533, in particular thanks to andrewroth's post. I've tested this as of the time of this post. One hopes that the changes will be deployed somewhere standard soon.

Installing ruby debugger on ruby 1.9.3-p125: 

export PATCH_LEVEL=`ruby -e 'puts RUBY_PATCHLEVEL'`
export RVM_SRC=$HOME/.rvm/rubies/ruby-1.9.3-p$PATCH_LEVEL/include/ruby-1.9.1
gem install archive-tar-minitar
gem install ruby_core_source -- --with-ruby-include=/$RVM_SRC
export RVM_SRC=$HOME/.rvm/rubies/ruby-1.9.3-p$PATCH_LEVEL/include/ruby-1.9.1/ruby-1.9.3-p$PATCH_LEVEL

wget http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
wget http://rubyforge.org/frs/download.php/63094/ruby-debug19-0.11.6.gem
wget http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
gem install linecache19-0.5.13.gem -- --with-ruby-include=/$RVM_SRC
# if that step failed, and you are running OSX Lion, then following this post can help you: 
# http://stackoverflow.com/questions/8032824/cant-install-ruby-under-lion-with-rvm-gcc-issues
# this happens if you recently installed xcode from the app store. 
# bizarrely, for me I had to do this: ln -s /usr/bin/gcc /usr/bin/gcc-4.2
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/$RVM_SRC

Then edit Gemfile: 

gem 'linecache19', '0.5.13', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/linecache19-0.5.13/"
gem 'ruby-debug-base19', '0.11.26', :path => "~/.rvm/gems/ruby-1.9.3-p#{RUBY_PATCHLEVEL}/gems/ruby-debug-base19-0.11.26/"
gem 'ruby-debug19', :require => 'ruby-debug'

Then install: 

bundle install

Solution 2:

I used the gem 'debugger' which is a fork of ruby-debug(19) that works on 1.9.2 and 1.9.3 and installs easily for rvm/rbenv rubies. It makes the error disappear !

Solution 3:

It looks like this is a known bug in ruby-debug-base, for the moment. I have added my comment to the issue on the bug tracker. Plase consider adding your notes as well:

http://rubyforge.org/tracker/index.php?func=detail&aid=29222&group_id=8883&atid=34290

In the meantime, ruby 1.9 has a built-in debugger; its just very slow. Manually add this require line to your code:

require 'debug'

Also, the debugger breaks on all StandardError exceptions by default, so do this when it first starts up:

catch off