Can't get debugger to work on MacOS X Lion/Rails 3.2/Ruby 1.9.3

I’m trying to get the ruby debugger working and can’t seem to get there.
Environment summary:

Mac OS X Lion
RVM
Ruby 1.9.3p125
Rails 3.2.3
Rspec 2.9.0

I’ve put the debugger statement in my controller like so:

def show
debugger
seasons = Season.where(:name=>params[:id])
puts @seasons
@season = seasons.first
puts @season
@season_entries = @season.season_entries
end

And run my spec like so:

$ bundle exec rspec -d spec/controllers/seasons_controller_spec.rb

Without the -d, my spec runs as I expect it - except the test fails for
a
reason I’m trying to figure out with the debugger. :slight_smile:

With the -d, I get this error:

/Users/dpassage/.rvm/gems/ruby-1.9.3-p125/gems/rspec-core-2.9.0/lib/rspec/core/configuration.rb:422:in
`rescue in debug=’: (RuntimeError)


dlopen(/Users/dpassage/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle,
9): Symbol not found: _ruby_current_thread
Referenced from:
/Users/dpassage/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
Expected in: flat namespace
in
/Users/dpassage/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle

/Users/dpassage/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle

If you have it installed as a ruby gem, then you need to either require
‘rubygems’ or configure the RUBYOPT environment variable with the value
‘rubygems’.

/Users/dpassage/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in
require' /Users/dpassage/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug-base19-0.11.25/lib/ruby-debug-base.rb:1:in<top (required)>’
/Users/dpassage/.rvm/gems/ruby-1.9.3-p125/gems/ruby-debug19-0.11.6/cli/ruby-debug.rb:5:in
`require’
[…]

Any ideas/advice?

-David

I’ve been having similar issues. There is apparently a fork of the
project
called simply ‘debugger’ as the original ruby-debug seems to have been
abandoned (heresay).

Let me know if you find a solution; debugger didn’t work for me, but it
is
likely that my system is borked uniquely as most I know have no trouble.

On Apr 8, 2012, at 2:43 , David Paschich wrote:

def show
$ bundle exec rspec -d spec/controllers/seasons_controller_spec.rb
try $ RUBYOPT=‘-r openssl’ bundle exec rspec -d
spec/controllers/seasons_controller_spec.rb

it looks weird but usually works :slight_smile:

Tomas Meinlschmidt, MS {MCT, MCP+I, MCSE, AER}, NetApp Filer/NetCache

www.meinlschmidt.com www.maxwellrender.cz www.lightgems.cz

On Saturday, April 7, 2012 9:57:52 PM UTC-7, @1337807 wrote:

I’ve been having similar issues. There is apparently a fork of the project
called simply ‘debugger’ as the original ruby-debug seems to have been
abandoned (heresay).

Let me know if you find a solution; debugger didn’t work for me, but it is
likely that my system is borked uniquely as most I know have no trouble.

Do you have a link to this fork? As one might imagine, googling for
“ruby
debugger” mostly comes up with ruby-debug.

-David

debugger" mostly comes up with ruby-debug.

I managed to find it by searching for “ruby-debug19 fork debugger”; the
github repository is here:

I did as directed and added the gem to my Gemfile, ran bundle install,
and
now I’m debugging! Thanks for the pointer, @1337807!

-David

On Sunday, April 8, 2012 1:24:05 AM UTC-7, tom meinlschmidt wrote:

try $ RUBYOPT=’-r openssl’ bundle exec rspec -d
spec/controllers/seasons_controller_spec.rb

it looks weird but usually works :slight_smile:

Nope, got the same error…

-D

Ryan B. has a revised screen cast on Railscasts from yesterday
(4.7.2012) that tackles this topic:
Episode #54: Debugging Ruby (revised)

It specifically tackles ‘how to debug a rails app using the “debugger”
gem’.

Might be worth a look … or watch!

Perfect, thanks! If only Ryan had posted this a couple days earlier,
would have saved me a few hours :slight_smile:

-David

On Apr 8, 2012, at 7:05 AM, Craig Kaminsky wrote:

Ryan B. has a revised screen cast on Railscasts from yesterday (4.7.2012)
that tackles this topic:
Episode #54: Debugging Ruby (revised)
#54 Debugging Ruby (revised) - RailsCasts

It specifically tackles ‘how to debug a rails app using the “debugger” gem’.

Might be worth a look … or watch!

Perfect, thanks! If only Ryan had posted this a couple days earlier,
would have saved me a few hours :slight_smile:

-David