I am trying to upgrade some gems, and bundler gives me the following when doing bundle update
:
Bundler could not find compatible versions for gem "actionmailer":
In Gemfile:
devise_invitable was resolved to 2.0.1, which depends on
actionmailer (>= 5.0)
rails (= 5.1.7) was resolved to 5.1.7, which depends on
actionmailer (= 5.1.7)
I fail to spot why it is not just using 5.1.7?
And another example:
Bundler could not find compatible versions for gem "redis":
In Gemfile:
redis (~> 3.3.1)
redis-objects (~> 1.2.1) was resolved to 1.2.1, which depends on
redis (>= 3.0.2)
sidekiq-limit_fetch was resolved to 3.4.0, which depends on
sidekiq (>= 4) was resolved to 5.2.8, which depends on
redis (>= 3.3.5, < 5)
sidekiq_newrelic_monitor was resolved to 0.1.2, which depends on
redis
split (~> 3.2.0) was resolved to 3.2.0, which depends on
redis (>= 2.1)
Why is it not just using 3.3.x?
Bundler version 1.17.3
UPDATE from comment:
cat Gemfile.lock | grep 'redis'
redis
redis
redis (3.3.5)
redis-objects (1.2.1)
redis (>= 3.0.2)
redis (>= 3.3.5, < 5)
redis (>= 2.1)
redis (~> 3.3.1)
redis-objects (~> 1.2.1)
3
Answers
So, it turned out that bundler 1.x has issues reporting the dependency issues correctly, so I upgraded to 2.x to better spot it. I did that by commenting out all but rails from my gemfiles. Then ran
bundle update
one at a time, while commenting back in more and more of the gems. As dependency issues surfaced it resolved them.Can you specify the version of actionmailer yourself to the one you think will solve it, like so:
actionmailer, 5.1.7
If you encounter the problem while running
bundle update
, you can deleteGemfile.lock
file and runbundle update
again to regenerateGemfile.lock
, which might solve the problem.