Bundler could not find compatible versions for multiple gems that seem to fall within range of requirements

Multi tool use
Multi tool use


Bundler could not find compatible versions for multiple gems that seem to fall within range of requirements



I'm trying to use a gem spree, which depends on kaminari (~> 1.0.1). In my Gemfile.lock, I have kaminari (= 1.1.1). This satisfies the requirement for spree, since it's greater than or equal to the last digit. However, I'm getting this error when I try to bundle:


spree


kaminari (~> 1.0.1)


Gemfile.lock


kaminari (= 1.1.1)


spree


Bundler could not find compatible versions for gem "kaminari":
In snapshot (Gemfile.lock):
kaminari (= 1.1.1)

In Gemfile:
activeadmin (~> 1.3) was resolved to 1.3.0, which depends on
kaminari (>= 0.15)

rails_admin (~> 1.3) was resolved to 1.3.0, which depends on
kaminari (< 2.0, >= 0.14)

spree (~> 3.5.0) was resolved to 3.5.0, which depends on
spree_core (= 3.5.0) was resolved to 3.5.0, which depends on
kaminari (~> 1.0.1)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.



I'm not sure why v1.1.1 doesn't satisfy the requirements for all the gems in question, since it seems to fall within the range for all gems in question. I tried running bundle update, but then I get a long list of gem incompatibilities, none of which make sense to me either, since their requirements all seem to fall within range of the version I have in my lock file. For instance,


bundle update


Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
carrierwave (~> 1.2) was resolved to 1.2.2, which depends on
activemodel (>= 4.0.0)

rails (~> 5.1.6) was resolved to 5.1.6, which depends on
activemodel (= 5.1.6)

web-console (>= 3.3.0) was resolved to 3.6.2, which depends on
activemodel (>= 5.0)

Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
annotate (~> 2.7) was resolved to 2.7.4, which depends on
activerecord (< 6.0, >= 3.2)

friendly_id (~> 5.2) was resolved to 5.2.4, which depends on
activerecord (>= 4.0.0)

rails (~> 5.1.6) was resolved to 5.1.6, which depends on
activerecord (= 5.1.6)

activeadmin (~> 1.3) was resolved to 1.3.0, which depends on
ransack (~> 1.3) was resolved to 1.8.8, which depends on
activerecord (>= 3.0)

spree_gateway (~> 3.3) was resolved to 3.3.3, which depends on
spree_extension was resolved to 0.0.5, which depends on
activerecord (>= 4.2)

Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
activeadmin (~> 1.3) was resolved to 1.3.0, which depends on
arbre (>= 1.1.1) was resolved to 1.1.1, which depends on
activesupport (>= 3.0.0)

carrierwave (~> 1.2) was resolved to 1.2.2, which depends on
activesupport (>= 4.0.0)

activeadmin (~> 1.3) was resolved to 1.3.0, which depends on
inherited_resources (>= 1.7.0) was resolved to 1.8.0, which depends on
has_scope (~> 0.6) was resolved to 0.7.2, which depends on
activesupport (>= 4.1)

jbuilder (~> 2.5) was resolved to 2.7.0, which depends on
activesupport (>= 4.2.0)

kaminari (~> 1.0.1) was resolved to 1.0.1, which depends on
activesupport (>= 4.1.0)

rails (~> 5.1.6) was resolved to 5.1.6, which depends on
activesupport (= 5.1.6)

activeadmin (~> 1.3) was resolved to 1.3.0, which depends on
ransack (~> 1.3) was resolved to 1.8.8, which depends on
activesupport (>= 3.0)

spring was resolved to 2.0.2, which depends on
activesupport (>= 4.2)

sass-rails (~> 5.0) was resolved to 5.0.7, which depends on
sprockets-rails (< 4.0, >= 2.0) was resolved to 3.2.1, which depends on
activesupport (>= 4.0)

Bundler could not find compatible versions for gem "kaminari":
In Gemfile:
kaminari (~> 1.0.1)

activeadmin (~> 1.3) was resolved to 1.3.0, which depends on
kaminari (>= 0.15)

rails_admin (~> 1.3) was resolved to 1.3.0, which depends on
kaminari (< 2.0, >= 0.14)

Bundler could not find compatible versions for gem "spree_core":
In Gemfile:
spree (~> 3.5.0) was resolved to 3.5.0, which depends on
spree_core (= 3.5.0)

spree_gateway (~> 3.3) was resolved to 3.3.3, which depends on
spree_core (< 4.0, >= 3.1.0)



These errors raise a whole new set of questions, since I don't see any conflicts in versions for any of the gems.



For activemodel, why can't it use 5.1.6? Doesn't that satisfy all the requirements?


activemodel



For activerecord, why can't it use 5.1.6? Doesn't that satisfy all the requirements?


activerecord



For activesupport, why can't it use 5.1.6? Doesn't that satisfy all the requirements?


activesupport



For kaminari, why can't it use 1.0.1? Doesn't that satisfy all the requirements?


kaminari



For spree_core, why can't it use 3.5.0? Doesn't that satisfy all the requirements?


spree_core



How does one go about resolving these issues? I've tried running bundle update for all gems and for individual gems, but I get the same error message either way.


bundle update




2 Answers
2



This satisfies the requirement for spree, since it's greater than or equal to the last digit.



That's not quite correct, the docs for Bundler's Gemfile state:



The specifier ~> has a special meaning, best shown by example. ~> 2.0.3 is identical to >= 2.0.3 and < 2.1.


~>


~> 2.0.3


>= 2.0.3


< 2.1



So in your case, for kaminari, ~> 1.0.1 would mean '>= 1.0.1' and '< 1.1', which (obviously) 1.1.1 does not meet.


~> 1.0.1


'>= 1.0.1'


'< 1.1'


1.1.1



As for the others, everything looks to me like it'd work, though I notice a lot of the ones failing need something to do with spree or kaminari, so maybe fixing the one will help those. The others could also (maybe) be cascading errors, kind of like a missing parenthesis or comma in one place can cause syntax errors through the entire file, maybe just the one error is cascading through the rest of the bundle, I'd take care of Kaminari and then see what you're left with.





I must have missed that. Well I've tried specifying gem 'kaminari', '~> 1.0.1' at the top of my Gemfile, but running bundle install gives me You have requested: kaminari ~> 1.0.1 The bundle currently has kaminari locked at 1.1.1. Try running 'bundle update kaminari' If you are updating multiple gems in your Gemfile at once, try passing them all to 'bundle update'. After I run bundle update kaminari, it gives me the same long list of incompatibilities. I've tried deleting my .lock file, and I've tried gem install kaminari -v '~> 1.0.1'
– Doug
Jun 30 at 20:35



gem 'kaminari', '~> 1.0.1'


bundle install


You have requested: kaminari ~> 1.0.1 The bundle currently has kaminari locked at 1.1.1. Try running 'bundle update kaminari' If you are updating multiple gems in your Gemfile at once, try passing them all to 'bundle update'


bundle update kaminari


gem install kaminari -v '~> 1.0.1'





@Doug Just out of curiosity, what happens if you temporarily comment out rails_admin from your gem file? I've recreated a Gemfile as best I could from your error messages and everything works perfect until I try adding in that gem, then all hell breaks loose for me
– Simple Lime
Jun 30 at 21:09






Strange, commenting out rails_admin fixed the problem... But it says it requires kaminari (< 2.0, >= 0.14).
– Doug
Jun 30 at 21:24


rails_admin


kaminari (< 2.0, >= 0.14)



Have you verified whether the version of spree you're trying to install is compatible with the higher version of kaminari? try downgrading the kaminari gem to "~> 1.0.1" to see if that helps.



if that does not work, then another suggestion would be to run "bundle update" on your current gemset "before" you add "spree" to your Gemfile to make sure you are working with all the latest versions of your currently installed gems.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

rlBd,hCQ g8COJwe4,0Nx0NH WR1K,ROm7FITfqY5x43YSUUjsIJBgMOGG76OGwIflfslcJCoyO BZoD1Y71TyiWAbTL A3M,r867 2
PaRL,Fu6oV6hmhIjb6tHx HdfY6,t O8g,k4OiH4V Sqp BDk5 vmoFPzqe,EwlK9

Popular posts from this blog

PySpark - SparkContext: Error initializing SparkContext File does not exist

django NoReverseMatch Exception

Audio Livestreaming with Python & Flask