Edit 2012-07-05: You can now install
rack-debug in a much more easy way by
using my debugger-rails gem.
In my last post we learned how to debug ruby scripts. It can be done
as well with a rails application, you just have to start it with
-u means to start on debug mode. Just make sure you have the
ruby-debug gem installed.
That works amazing… unless you use Passenger on development. If you do, then
you’ll need a different way to run the debugger. Don’t panic, it’s quite easy,
thanks to the rack-debug gem.
Rack::Debug is a gem which provides an easy interface to
applications running on Passenger. And the good thing about it is that… it
Now that your gem is installed, add the middleware to Rails.
And the helper rake tasks.
Now you can just add a
debugger statement on any line on your application,
restart it and run
rake debug so that the Rack::Debug gem connects to the
debugger. Easy, eh?
Enjoy the debugging!