Recently I started using Sublime Text 2 for Rails application and I found it is really great. Then I needed to debug a method. I just put debugger in a method and nothing happened. By the way, I'm using passenger.
Then I installed pry_debug and also put a binding.pry keyword and there was no result either. No breaking. Now in Gemfile I have pry_debug and debugger gems.
So can I debug Rails applications in Sublime text 2? Especially using pry_debug gem.
You do not use ruby-debug trough IDE, well at least not with Sublime Text 2. Put following code in place. Assuming you have installed ruby-debug gem.
require 'ruby-debug'
...
debugger
...
And when you start the server you will have debug console from that break point (debugger line of code). From there you can use n (next), c (continue), to navigate trough the code or my favorite irb to change it in run time. This is old screen cast but debugger still works the same way.
If you really want IDE debugging you can look into Rad on Rails (official support for Ruby 1.8.x I think) but trust me, that is more trouble than it is worth. Stick to Sublime Text 2 since it is awesome!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With