1

I am installing through Bundler a gem A that depends on a version of another gem faraday-stack 0.1.3 that is lower than what is required (requires faraday-stack 0.1.5) by still another gem B. How can I force the first gem A's dependency to the higher one 0.1.5?

sawa
  • 165,429
  • 45
  • 277
  • 381

2 Answers2

2

If gem A is specifying an exact version of 0.1.3, that indicates that it is incompatible with later versions such as 0.1.5.

It could be that the dependency for gem A is incorrectly over-constrained, and in reality it would work with 0.1.5 if the gemspec allowed it. If that's the case, the gemspec for gem A needs to be fixed to have a more permissive dependency on faraday-stack (for example, ~> 0.1.5, which means the same as >= 0.1.5, < 0.2.0).

On the other hand, if gem A actually is incompatible with faraday-stack 0.1.5, then what you're trying to do won't work. Either gem A will need to be updated so that it works with 0.1.5, or gem B will need to be updated so that it works with 0.1.3.

Tim Moore
  • 8,958
  • 2
  • 23
  • 34
0

Just specify the version of the faraday-stack gem in your Gemfile before gem A or B.

gem 'faraday-stack', '0.1.5'
gem 'A'
gem 'B'

I believe this is pretty much a duplicate of this question.

Community
  • 1
  • 1
Jack Bracken
  • 1,233
  • 12
  • 23