i want to debug ROR without going through the effort of putting inspect method for every relevant object in the controller as well in the model.is there a better way as we have in Java (Run time debugger using eclipse).i know that I can Use Rails.logger and also make use of rails Console(irb`).i am even aware of debugging/inspecting elements in erb/rb file.Still is there a better,quick and reliable way to debug a Rails app.
-
There are some console debuggers. RubyMine offers visual debugger (or so they say, I have never used it. Debug printing is usually enough for me).Sergio Tulentsev– Sergio Tulentsev2013-03-20 11:06:12 +00:00Commented Mar 20, 2013 at 11:06
Add a comment
|
3 Answers
There is much better, see this railscats.
It presents two great gems, especially Better Errors
Otherwise, you could use pry with rails, see this railscast.
2 Comments
Sergio Tulentsev
better_errors is hardly a debugger replacement. What if there's no error, and just a breakpoint?
muttonlamb
you can also throw in a raise where you want the equivalent of a breakpoint when using better_errors. I agree though, it's not a replacement. Different people like different methods though
Add this lines to your application's Gemfile
group :development do
gem 'ruby-debug19'
end
then run cammand
bundle install
add debugger within your controller or model method, stop the rails server and restart again. Whenever rails found word debugger it stops control at that point. You can easily debug your value or object.
Hope this will helps you.