You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rdbg + Bundler -> numerous gem version conflicts #676
Describe the bug
My goal is to debug RSpec test cases in a large project that uses Bundler. (Integrating with VS Code, but that is not relevant to this bug report.) The command that I invoke is:
However, my bundle includes conflicting versions of numerous gems that ruby/debug requires by itself: io-console, irb, json, reline and timeout. It's not clear to me whether all of these are default gems -- I don't think so, but maybe I'm wrong and the default gems have exploded in Ruby 3! Regardless, I end up with conflicts because Bundler tries to activate the version in my Gemfile, but debug has already activated a different version. It raises:
You have already activated io-console 0.5.11, but your Gemfile requires io-console 0.5.6. Since io-console is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports io-console as a default gem. (Gem::LoadError)
This is very mysterious considering that this happens even when debug is explicitly installed in the bundle and rdbg is invoked via bundle exec.
To Reproduce
Add any of the gems mentioned above to the Gemfile; io-console 0.5.6 is a good test case with Ruby 3.1.1 and rdbg 1.4.0. Then just invoke rdbg and ask it to run bundle exec on any script file that activates the bundle. (I can create a self-contained reproduction as a gist, if you are interested.)
Expected behavior
There should be some way to use rdbg with Bundler, because both of them are default gems
I have a workaround (align Gemfile perfectly with default gems) but wish I didn't need to do this
Additional context
I realize this isnt' necessarily a bug in debug; I'm hoping for guidance. Happy to work on a fix, if this is indeed a bug.
Now that I understand the root cause, the workaround doesn't seem so bad. In fact, it seems fairly sane: if I upgrade to a newer Ruby, I should be willing to delete Gemfile.lock and re-resolve all dependencies, including default gems.
Still: I wanted to show you the issue and give you an easy repro. I'm not sure that debug can do anything about this, other than avoid requiring any default gems.
As you said it seems difficult to solve it if we use rdbg (rdbg command
I tried to add gem 'debug' in Gemfile and run bundle install, debug 0.2.1 (not debug.gem) is installed!
Thank you again and I close this ticket. If anyone has better solution, please reopen it.
Activity
ko1 commentedon Jul 5, 2022
Sorry my environment says ruby 3.1.1 has io-console 0.5.11.
Could you make another example?
BTW I'm happy if you write step-by-step repro steps.
xeger commentedon Jul 5, 2022
Thank you for your quick reply. Here is a repro for you:
https://gist.github.com/xeger/e8cc98437d9c8351c8ed8dc4faa19591
The README has instructions on how to repro.
Now that I understand the root cause, the workaround doesn't seem so bad. In fact, it seems fairly sane: if I upgrade to a newer Ruby, I should be willing to delete Gemfile.lock and re-resolve all dependencies, including default gems.
Still: I wanted to show you the issue and give you an easy repro. I'm not sure that
debugcan do anything about this, other than avoid requiring any default gems.ko1 commentedon Jul 6, 2022
Thank you, I can reproduce it very easy.
As you said it seems difficult to solve it if we use
rdbg(rdbg commandI tried to add
gem 'debug'in Gemfile and runbundle install,debug 0.2.1(not debug.gem) is installed!Thank you again and I close this ticket. If anyone has better solution, please reopen it.
ko1 commentedon Jul 6, 2022
Note that
bundle updatealso fixes the issue.xeger commentedon Jul 6, 2022
Oh; and, you have found an excellent solution!
With the "new debug" in the Gemfile, Bundler warns about version conflicts (i.e.
irbmust be newer) andbundle exec rdbgworks as expected.🎉
ko1 commentedon Jul 6, 2022
Wow, thank you.