Cannot use ruby-debug19 with 1.9.3-p0? [duplicate]
Asked Answered
L

3

20

Possible Duplicate:
Rails 3.1 and Ruby 1.9.3p125: ruby-debug19 still crashes with “Symbol not found: _ruby_threadptr_data_type”

I run this:

gem install ruby-debug19

And in my cucumber env.rb file, I have this:

require 'ruby-debug'

When I try to run, though, I get this exception:

/home/skendall/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so: undefined symbol: ruby_current_thread - /home/skendall/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.so (LoadError)

What do I need to do to get ruby-debug to work with 1.9.3-p0?

Livelong answered 4/12, 2011 at 20:14 Comment(1)
See https://mcmap.net/q/145852/-debugging-in-ruby-1-9Duckweed
A
22

UPDATE: ruby-debug19 is not maintained anymore. This question and my answer have become irrelevant, it's far easier to use the 'debugger' gem instead.

See Debugging in ruby 1.9

I also ran into this, and found the solution in Ruby 1.9.3 and ruby-debug. You need to install not-yet-officially-released versions of ruby-debug-base19 and linecache19. The currently released versions indeed cause the exception you had.

Use this gist.

#To install ruby-debug on Ubuntu ruby-1.9.3 you need to download from http://rubyforge.org/frs/?group_id=8883

linecache19-0.5.13.gem 
ruby_core_source-0.1.5.gem 
ruby-debug19-0.11.6.gem 
ruby-debug-base19-0.11.26.gem

#Then in your console

export RVM_SRC=/your/path/to/ruby-1.9.3
# Note, your source path should be something like /home/user/.rvm/src/ruby-1.9.3-p0

gem install archive-tar-minitar
gem install ruby_core_source-0.1.5.gem -- --with-ruby-include=/$RVM_SRC
gem install linecache19-0.5.13.gem -- --with-ruby-include=/$RVM_SRC
gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=/$RVM_SRC
gem install ruby-debug19-0.11.6.gem -- --with-ruby-include=/$RVM_SRC
Anemology answered 4/12, 2011 at 20:20 Comment(4)
I added the full set of instructions in case any of the links die.Livelong
And I tried to follow these directions today, had trouble with version numbers, etc, and wrote up the updated procedure on this other SO thread: https://mcmap.net/q/146252/-rails-with-ruby-debugger-throw-39-symbol-not-found-_ruby_current_thread-loaderror-39. You might find it even easier to followComplacent
The important parts I think are requiring correct versions. This in my Gemfile may help: gem 'linecache19', '~> 0.5.13' gem 'ruby-debug-base19', '~> 0.11.26' gem 'ruby-debug19', :require => 'ruby-debug'Mamelon
Well, I get: Could not find gem 'ruby-debug-base19 (~> 0.11.26) ruby' in the gems available on this machine.Glennaglennie
C
3

This is a known bug. There's reportedly some work arounds here, here and finally here.

Carraway answered 4/12, 2011 at 20:22 Comment(0)
M
3

If the workarounds are annoying and/or impossible due to your rvm/bundler setup, which is the case with me, consider pry, and optionally the pry-debug plugin. Pry might be a more generally useful tool than ruby-debug anyways.

Malinda answered 29/1, 2012 at 3:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.