- Add these gems in gemfile or gemspec:
gem 'ruby-debug'
gem 'columnize'- Add
require 'ruby-debug'in your project. - Add breakpoints with
debuggerkeyword. - Run
jrubywith--debugflag:
jruby --debug -S bundle exec <command>Unlike pry or byebug where we can simply call the variable to see its value, we have to use p to print the value. For example, my_var vs p my_var. We can change this behavior to autoeval by adding the following lines to a ~/.rdebugrc file:
set autolist
set autoeval
set autoreloadSimpleCov does not work with ruby-debug. Temporarily uncomment it from your MRI based while it runs on JRuby. See ruby-debug/ruby-debug#27 for more information.
https://github.com/jruby/jruby/wiki/UsingTheJRubyDebugger https://gist.github.com/klappradla/69029a982ade44e20e124c29b1c00541