Docker Compose service as remote interpreter can't install debugger gems
I'm using:
RubyMine 2023.1
Build #RM-231.8109.174, built on March 28, 2023
Runtime version: 17.0.6+10-b829.5 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.3.1
I have configured a remote interpreter using Docker-compose and I'm able to run the application.
When I try to debug it RubyMine ask me to install the debug gems but it fails with the following errors:
Failed to Install Gems. Following gems were not installed: /Users/my-user/Library/Application Support/JetBrains/Toolbox/apps/RubyMine/ch-0/231.8109.174/RubyMine.app/Contents/plugins/ruby/rb/gems/ruby-debug-ide-3.0.0.beta.10.gem: Could not find a valid gem 'ruby-debug-ide-3.0.0.beta.10.gem' (>= 0) in any repository /Users/my-user/Library/Application Support/JetBrains/Toolbox/apps/RubyMine/ch-0/231.8109.174/RubyMine.app/Contents/plugins/ruby/rb/gems/debase-3.0.0.beta.6.gem: Could not find a valid gem 'debase-3.0.0.beta.6.gem' (>= 0) in any repository
How can I solve it?
请先登录再写评论。
Well, this is weird. I backed up and removed the gems under `/Applications/RubyMine.app/Contents/plugins/ruby/rb/gems` and all of a sudden debugging started working.
I have had zero success debugging Ruby apps (Rails 6 & 7) in docker containers that I spin up with docker-compose.
I've tried all of the RubyMine guides from JetBrains and whatever I could find online, but nothing has worked so far.
Very frustrating.
Sorry to hear about your experience. Would it be possible to share your Docker configuration files and Gemfile + Gemfile.lock?
After reading another post I removed a debase gem that I had in my gemfile and it only fails on installing ruby-debug-ide:
docker-compose.yml
Gemfile
Gemfile.lock
I just want to add to this that I followed the instruction here and couldn't get it to work either: https://www.jetbrains.com/help/ruby/using-docker-as-a-remote-interpreter.html#debug_with_docker_compose
We have a YouTrack issue related to debugging with docker-compose so it'd be great if you could add your vote to it (https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications)
https://youtrack.jetbrains.com/issue/RUBY-31246/Could-not-find-a-valid-gem-ruby-debug-ide-2.3.13.gem-0-in-any-repository
In addition, please try the workaround mentioned in the comment.
I have JetBrains Toolbox, so the RubyMine app is stored somewhere else–`~/Library/Application Support/JetBrains/Toolbox/apps/RubyMine/ch-0/231.8109.174/RubyMine.app/Contents/plugins/ruby/rb/gems`.
I removed the gems, restarted RubyMine, and successfully debugged some specs! Thank you, John Cavalieri!
FWIW, my project is a Rails 7 app (v7.0.4.3) and `Gemfile` is loading the `debug` gem.
BTW, this workaround also solved a problem with another Rails app on Docker that I had cloned and wanted to start working on. For the new project, RubyMine failed with an error message (numerous times) when trying to set up a Remote Interpreter in the Ruby SDK and Gems Settings page.
After deleting the embedded gems, RubyMine connected to the new project's Docker via the Remote Interpreter without a problem.
Finally got Rails 7 on docker-compose to work with RubyMine debugger.
Wrote a little post:
https://www.notion.so/vptown/The-Micro-SaaS-Studio-3b63e0c7ec954e5c9b70a30afafedf31?p=32756a64d64c4e92a2c2a350a0e6e6d0&pm=s
Now trying to figure out how to have a running web container along with debugging some test.
I think it is related to puma's pid because test debugger is running on a different port than dev (3000)
Stephane Bounmy do you mean running 2 different Run configurations in debug mode in docker?