2

So I'm moving from 4.2.11 -> 5.2.3, and when I try to bundle install, I get a ton of sections of output that look similar to this:

Bundler could not find compatible versions for gem "rest-client":
    In Gemfile:
        rest-client (~> 1.6.9)

    ncsa_data_bridge (= 0.3.0) was resolved to 0.3.0, which depends on
        rest-client (>= 1.0.2, < 2.0)

Many of these sections are semi-sensical, but there are a bunch that have, as above, called out incompatible versions, yet the versions appear to be fine. In the one above, the Gemfile asks for ~> 1.6.9, and the ncsa_data_bridge wants >= 1.0.2, < 2.0.

My confusion is that it appears that the versions are fine. What does this actually mean? In other cases the mismatch in versions make more sense and I can fix them by specifying a version that is compatible. In this case I don't even know where to start...

To be clear, I don't need to know how to fix that specific issue--just how to approach the issue in a more generalized sense.

thanks!

jaydel
  • 14,389
  • 14
  • 62
  • 98

1 Answers1

1

I'm no expert but in such situations I'd just remove versions from the Gemfile and let bundler deal with it. In most cases it gets it done but in some cases like some shady unmaintained gems I'd have to jump in and patch something or refactor some code to get rid of the dependency problems.

My rule of thumb in such situations is to ditch the gem and find an alternative with or without refactoring required if the gem has been unmaintained for more than a a few months or too many similar issues are found unresolved.

Your goal should be to minimize time waste.

Nick M
  • 2,424
  • 5
  • 34
  • 57
  • I ended up going down a path similar to this. because I had SO many gems and a bunch were not RubyGems sourced (a few in house gems, a couple direct github references). So I used rvm to completely empty my gemset, then commented out all my gems but the new Rails version and bundle installed. Then on green, I'd uncomment a few and repeat. in the end it ended up being that I had to remove versions on some gems, and re-add the new versions after bundle installing. I did end up with one in house gem that I had to go "fix" to use an updated version of one gem. – jaydel Jul 12 '19 at 13:38