Debugging in Rails?

How would you debug “relatively” successfully in RubyonRails? I know and widely use:

  • Terminal
  • Rails Console
  • Developer Tools
  • Log files (production / development)

This would help to debug a lot faster if there are other methods available regardless of the environment in which it works.

+4
source share
1 answer

These gems make debugging a Rails application much easier without using a real debugger:

group :development do
  gem "better_errors"
  gem "binding_of_caller"
  gem "pry-rails"
end

Improved errors gives you a full stack trace with REPL in your browser when you overcome the error.

Pry binding.pry - , . , exit, .

, , best_errors REPL , pry , , .

+6

Source: https://habr.com/ru/post/1525065/


All Articles