3

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?

mojaomi
  • 115
  • 6
  • i have the exact same problem: did you find a solution? – Mathieu Jul 14 '22 at 09:45
  • Unfortunately not yet. I changed the Rails version (7.0.2.4-> 7.0.3) and recreated the app, but the situation didn't change. – mojaomi Jul 16 '22 at 01:28
  • Same problem, when starting with "rails s"(without foreman gem) instead "./bin/dev/" it's works fine – FVVID Oct 17 '22 at 13:41
  • Thank you for your comment. I've confirmed that it works normally if it is started with "rails s". – mojaomi Oct 20 '22 at 02:38
  • I had a similar issue few years ago using overmind which had the same problem as foreman. It seems that it is not as straight forward as is when you start the server using bn/dev or rails s. You need to connect to the debugging process. In terminal open a new window and from the same folder where your app is run: bundle exec rdbg -a – luigi7up Jul 27 '23 at 06:11

1 Answers1

0

From FVVID’s comment, the cause seems to be that the server was started with "bin/dev" command.

My environment is "importmap + tailwindcss".
"tailwindcss" is not updated during debugging, so I can now use the debug gem by starting the server with the "rails s" command instead of "bin/dev".

Thanks to FVVID.

mojaomi
  • 115
  • 6