23
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Railsでデバッグするときに使用するgem

Posted at

better_errors + pry を組み合わせています。
better_errorsはエラー時の画面を見やすく整理してくれて、例外吐いたところでrubyのコマンド叩いて変数の内容をダンプしたりできるのでとても便利です。

Gemfile
# Debugging tools
group :development, :staging do
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'letter_opener'
  gem 'mail_view'
  gem 'pry-rails'
  gem 'pry-debugger'
  gem 'pry-remote'
  gem 'quiet_assets'
  gem 'sextant'
end

pryは

require 'pry'

して
ブレークポイントを張りたいところで

binding.pry

と記述します。書いた所で rails server したターミナルが停止します。

23
24
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?