Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debug session doesn't work with debug gem

I am making a personally developed application.
I have tried to debug with debug gem which became standard from rails 7, but (rdbg) does not work smoothly even if I enter debug session. I don't know what is the cause. Please let me know if any advice.
My Gemfile as following.

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.1.2'

gem 'rails', '~> 7.0.2', '>= 7.0.2.4'
gem 'sprockets-rails'
gem 'pg'
gem 'puma'
gem 'importmap-rails'
gem 'turbo-rails'
gem 'stimulus-rails'
gem 'tailwindcss-rails'
gem 'jbuilder'
gem 'redis'
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
gem 'bootsnap', require: false

gem 'sorcery'
gem 'rails-i18n'
gem 'config'
gem 'simple_form'
gem 'enum'
gem 'enum_help'
gem 'draper'
gem 'redis-actionpack'
gem 'carrierwave'
gem 'validates_email_format_of'

group :development, :test do
  gem 'annotate'
  gem 'capybara'
  gem 'debug', platforms: %i[mri mingw x64_mingw]
  gem 'factory_bot_rails'
  gem 'faker'
  gem 'launchy'
  gem 'rails-controller-testing'
  gem 'rspec-rails'
  gem 'shoulda-matchers'
  gem 'webdrivers'
end

group :development do
  gem 'web-console'
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'solargraph'
  gem 'letter_opener_web'
end

I have put 'debugger' in conrtroller and enter debug session, terminal console will be the following screen.

enter image description here

My understanding is that it should be prompted (rdbg) and wait for debug commands.
However, no matter how long I wait, (rdbg) does not appear.
There is no response when I press n (next) command. (Sometimes it works, but it takes a lot of time and is completely useless.)
Can you give me some advice?

like image 456
mojaomi Avatar asked Oct 16 '25 19:10

mojaomi


1 Answers

If you're using Overmind, here's what worked for me:

  1. Open a new shell / terminal window
  2. Atttach the debugger: (in my case I'm using ruby/debug):
rdbg --attach

And you're off to the races!

like image 113
BenKoshy Avatar answered Oct 19 '25 11:10

BenKoshy