Bundler could not find compatible versions for gem
Solution 1
Delete the contents of Gemfile.lock
, and run bundle install
again. That's been working for me.
Solution 2
Did you run bundle update
as the error message points out? bundle install
handles changes to the Gemfile and bundle update
upgrades gems that are already managed by Bundler. The Gemfile.lock file locks in version numbers, bundle update
will update any of those that aren't directly specified in your Gemfile (like gem 'rails', '3.0.9'
).
Deleting the Gemfile.lock will work, but running bundle update
is better.
Solution 3
You can't simply delete you Gemfile.lock
if that is a solution then why Gemfile.lock
is exist in the first place, you code depend on the versions locked in this file, try to only update the Gem which cause the conflict by using bundle update gem_name
and you have to check the ReadMe if any changes needed to work with the new version otherwise you are breaking your code or others code.
Solution 4
I found that by removing the specified version of rails solved the problem for me .... instead of:
gem rails, '4.0.4'
I did
gem rails
followed by deleting the Gemfile.lock and re-running bundle install
Solution 5
If deleting Gemfile.lock
doesn't work there is another possibility:
It may be possible a gem you are depending on has inadvertently included its own Gemfile.lock in its .gem file. The solution is to update the offending gems to not include a Gemfile.lock, rebuild and reinstall.
Comments
-
hagope almost 4 years
I've added a gem 'koala' to my Gemfile and seems to have thrown gem versions out of whack when I run the 'bundle install' command:
Bundler could not find compatible versions for gem "faraday": In snapshot (Gemfile.lock): faraday (0.6.1) In Gemfile: koala (~> 1.2.0beta1) depends on faraday (~> 0.7.4) Running `bundle update` will rebuild your snapshot from scratch, using only the gems in your Gemfile, which may resolve the conflict.
How can I resolve this conflict?
-
Ira Herman almost 12 yearsI was unable to install rails_admin, and this just fixed it for me too. Thanks for posting!
-
FreePender about 6 yearsThis will spontaneously upgrade a whole bunch of your gems. It's better to do them one at a time and test, as updating gems can introduce bugs
-
TechDogLover OR kiaNasirzadeh over 4 yearsif someone has error
Bundler could not find compatible versions for gem "jekyll"
, just delete version part of your projectGemfile
, i mean changegem "jekyll", "~> 4.0.0"
togem "jekyll"
-
Vadorequest about 4 yearsComing from JS world, I had used fixed versions for all my gems and all hell broke loose. I wanted to configure Jekyll with Github Pages... The trick was to remove all fixed versions and remove the lock file then run
bundle
again