Reputation: 2469
I'm building this gem which is currently private but will be open sourced later on.
In the .gemspec
I have spec.add_dependency 'hashie', '~> 3.3.2'
.
When using the gem in my app I get:
Bundler could not find compatible versions for gem "hashie":
In Gemfile:
desk (~> 1.0.4) ruby depends on
hashie (~> 2.1) ruby
my_gem (>= 0) ruby depends on
hashie (3.3.2)
How do I go about solving such issue?
One way is to remove the lock on ~> 3.3.2
which works but I prefer not to do that.
I have tried deleting the Gemfile.lock
from the app and run bundle install/update
but that didn't work either.
Upvotes: 0
Views: 357
Reputation: 2469
I have accepted @ascar answer because that's the right thing to do. People suggest that you should fork gems to ensure compatibility.
Now what have I done in the spirit of OSS :) I have actually submitted a PR on the Desk gem to update the hashie gem.
Upvotes: 1
Reputation: 1642
Welcome to dependency hell :). It's not possible to use two different versions of the same gem.
You could try to fork desk and update to hashie ~> 3.3.2
there or simply go with hashie ~> 2.1
and downgrade your hashie to a 2.x version.
Upvotes: 0