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

96 views
Skip to first unread message

David Paschich

unread,
Apr 7, 2012, 8:43:45 PM4/7/12
to rubyonra...@googlegroups.com
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. :)

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


Jonan Scheffler

unread,
Apr 8, 2012, 12:57:52 AM4/8/12
to rubyonra...@googlegroups.com

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.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/sqg6Oyhtz7wJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Tom Meinlschmidt

unread,
Apr 8, 2012, 4:24:05 AM4/8/12
to rubyonra...@googlegroups.com

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

> 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

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

it looks weird but usually works :)

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

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

Craig Kaminsky

unread,
Apr 8, 2012, 10:05:43 AM4/8/12
to rubyonra...@googlegroups.com
Ryan Bates 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!

David Paschich

unread,
Apr 8, 2012, 12:25:43 PM4/8/12
to rubyonra...@googlegroups.com


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 :)

Nope, got the same error...

-D
 

David Paschich

unread,
Apr 8, 2012, 12:26:54 PM4/8/12
to rubyonra...@googlegroups.com


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

David Paschich

unread,
Apr 8, 2012, 2:06:54 PM4/8/12
to rubyonra...@googlegroups.com

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

https://github.com/cldwalker/debugger

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

David Paschich

unread,
Apr 9, 2012, 2:14:06 PM4/9/12
to rubyonra...@googlegroups.com
Perfect, thanks! If only Ryan had posted this a couple days earlier, would have saved me a few hours :)

-David

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

-David

> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.

> To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/j9U5tLmWfwEJ.

Reply all
Reply to author
Forward
0 new messages