Is it possbile to have Rubymine connect to (and restart) an installed/running instance of Puma-dev for the debugging session?
I use Puma-dev to test my Rails app on "Appname".test, yet if I need to debug something in the app and want to use Rubymine's built-in debugger, I can only let it start an additional instance of Puma on Port 3000 (or whatever Port I choose) but not the already running Puma-dev on port 80/443.
Is it at all possible?
This is possible with remote debugging. To configure, you have to make some changes to your app:
Add export RUBY_DEBUG_PORT=1234
to .env
or .powenv
or any file puma-dev will load an environment variable from. Feel free to use whatever port you'd like, although RubyMine uses 1234 by default.
Add the ruby-debug-ide
and debase
gems to your project's Gemfile.
Add an initializer to your project to initialize remote debugging, like so:
if Rails.env.development? && ENV['RUBY_DEBUG_PORT']
Debugger.start_server nil, ENV['RUBY_DEBUG_PORT'].to_i
end
RUBY_DEBUG_PORT
. Set your local and remote root folders to your project root.