#54 Debugging Ruby (revised)
This episode will show you how to debug a rails app using the "debugger" gem: set a breakpoint, inspect variables and change the executed code at runtime.
- source codeProject Files in Zip (87.2 KB)
- mp4Full Size H.264 Video (12.8 MB)
- m4vSmaller H.264 Video (7.31 MB)
- webmFull Size VP8 Video (9.05 MB)
- ogvFull Size Theora Video (14.9 MB)
Nice-to-know episode! Any idea, why ruby-debug19 was abandoned?
@dominik it's not really abandoned, it's just not being looked after as it should be. It's a huge pain to install on Ruby 1.9.3 due to gems not released to rubygems.org! Personally I think it was about time it was forked considering 1.8.7's death is preeminent and 1.9.3 has been GA for over 6 months.
That qualifies for »abandoned«, in my opinion ;-)
I had have also trouble to install
ruby-debug19on some Debian machines with Ruby 1.9.2 using either RVM or rbenv.
debuggerworks like a charm :-)
Any tips for using debugger or pry with Pow?
you can use pry-remote: https://github.com/Mon-Ouie/pry-remote
Hi, I'm using pry and pry_debug in my rails application, have no problem at all with "rails console",but I can't figure out how to step when I include binding.pry in my controller. any hints please.
I found out about
adding this to Gemfile:
As always, good information. I use pry on a daily basis in both Rails and POR apps. Great tool for effective debugging.
Timezone is not easy as it looks. Timezone-related code must be carefully written.
I tried to find an easy way to set Rails
config.time_zoneto local but failed.
Now I use an initializer:
I switched to RubyMine from VIM a while ago b/c the remote degugger is such a pain to inject every time using VIM/TEXTMATE/WHATEVER. Visual debugging is REALLY nice :) I'm not sure what technique they use, but debugging has worked on Ruby 1.9.3 for a while with RubyMine.
THere is a a way to get ruby-debug working on ruby 1.9.3
put this in your gemfile
I found this at Stackoverflow
I know it is rather controversial but I found RubyMine IDE to be a great way to debug rails apps. It has very cool UI for debugger with breakpoints, visual stack and so forth.
If I can get some attention or upvotes, you'll help stamp out ruby-debug19 from the Rails Gemfile template https://github.com/rails/rails/pull/5835
debugger don't work properly with ruby 2.0. Try this https://github.com/deivid-rodriguez/byebug. It's almost the same. But it don't work with ruby 1.9.x. For ruby 1.9.3 works debugger fine.