Rails 3.1 and Ruby 1.9.3p125: ruby-debug19 still crashes with "Symbol not found: _ruby_threadptr_data_type" [duplicate]
Asked Answered
C

5

9

Possible Duplicate:
ruby-debug with Ruby 1.9.3?

I had heard rumors that ruby 1.9.3p125 has a solution for the ruby-debug19 problem, so per instructions on the RVM site, I reinstalled 1.9.3:

$ rvm reinstall 1.9.3 --patch debug --force-autoconf
$ ruby -v
  ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.2.0]

Then:

gem install ruby-debug19

Added this entry to my Gemfile:

gem 'ruby-debug19'

Then:

$ rails server -u         
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'
Exiting

To get past this error I changed my Gemfile entry to:

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

Now a new error from the server:

/Users/don/.rvm/gems/ruby-1.9.3-p125/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require': dlopen(/Users/don/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_threadptr_data_type (LoadError)
  Referenced from: /Users/don/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
  Expected in: flat namespace
 in /Users/don/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/don/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle

I'm very confused by the hundreds of posts out there on how to handle this ruby-debug19 issue. I was hoping it had been solved. Apparently not. Any suggestions? (If anyone suggests a patch, please provide step by step instructions on how to apply it. I've struggled with patches in the past.)

Coercion answered 25/2, 2012 at 7:30 Comment(0)
J
36

A fork of ruby-debug just called 'debugger' now exists that incorporates many of the fixes people had been deploying on top of ruby-debug19, so you should be able to just change your Gemfile to

gem 'debugger'

... and off you go.

Jussive answered 5/4, 2012 at 8:5 Comment(3)
Thank you so much for this, porting some templates from rails and I am not a rails guy..Barman
I got: Uncaught exception: superclass mismatch for class RemoteInterfaceThermometry
It works! Thank you. Note to readers that the old gem needs to be removed for this to work.Sundog
K
3

Long story short: it's not resolved, and official resolution will only come with a new version of ruby-debug19 or ruby-debug-base19. It's pretty aggravating, I know.

I've done a lot of digging on this, too, and I've kept an eye on things since 1.9.3 came out (because we'd love-love-love to use it in production). However, sadly, 1.9.3-p125 doesn't have a fix for ruby-debug. Only ruby-debug19 will have the fix for ruby-debug19, as the authors of ruby-debug19 and ruby-debug-base19 have been working on a patch and have an updated test build working on Ruby 1.9.3… but they haven't released it to the general public. ruby-debug-base19 hasn't seen a release in eons; ruby-debug19 even longer (since '09).

If you're on rvm head, you should be able to install 1.9.3-p125 with the added "falcon patch" found here (and noted about RVM here. This gist seems to have better instructions (it's a newer fork of the older one).

Knead answered 29/2, 2012 at 15:3 Comment(1)
I tried the falcon patch using rvm - still get a symbol error: Symbol not found: _ruby_current_thread (LoadError) :-(Coercion
B
3

The best thing to do is just use pry. Its an irb-like replacement for ruby-debug and it works with all version of Ruby with no nasty patching!

https://github.com/pry/pry

Butyraldehyde answered 29/2, 2012 at 15:11 Comment(4)
I know Pry is good for viewing program state, but does it let you follow through stack trace and code path? I've looked through the docs but couldn't find much of anything on it. EDIT: found pry-debug — I need to give that a shot.Knead
Scratch that; that wasn't what I was looking for with regards to pry. Instead, pry-nav looks like the ticket.Knead
pry is indeed a great tool. I've been using it as a stop-gap, but I really need "step", "next" and "continue" functionality. Benjamin - pry-nav looks very, very new. I tried using it when it was first posted, but couldn't get it to work consistently. Is it working for you?Coercion
It is, as a matter of fact. next doesn't QUITE work exactly the same as it does in ruby-debug, but it's a suitable, great-looking replacement so far. It's matured quite a bit.Knead
C
0

You must pass the --with-ruby-include and point it at your src directory for this to work.

(most of these answers elsewhere on SO have gone stale since 1.9.3-p125.)

I've written up new instructions here for ubuntu 11.10 that work on my machine, but give them a try on darwin and see if they help?: https://gist.github.com/2218661

Chosen answered 27/3, 2012 at 18:30 Comment(0)
C
0

I've been having similar problems using Rails 3.2 with Ruby 1.9.3p0 debugging in Aptana.
For me, new ruby-debug-base193 does not compile. But what works fine is a fix that has been posted elsewhere:

Gemfile:
gem 'ruby-debug-ide19'
gem 'ruby-debug-base19'

And then providing the missing is_binary_data? method somewhere. I put it in my Rails application.rb file like so:

class String
  def is_binary_data?
    ( self.count( "^ -~", "^\r\n" ).fdiv(self.size) > 0.3 || self.index( "\x00" ) ) unless empty?
  end
end
Carpel answered 25/4, 2012 at 21:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.