I constantly run into a problem where a Gemfile specifies to get the latest version of a gem, but given the constraints of my system I simply get an error because the latest version is not compatible with ruby.
For example let's say I have:
gem "my-gem", ">=1.2"
The latest version is 1.5, but only up to version 1.4 works with my version of Ruby. Instead of producing an error, it would make more sense to install 1.4, since it meets my requirement and works with what I have. (i.e. Bundler should install "the latest version that is satisfied by all dependencies" and produce an error when this version is less than what is specified in the Gemfile)
In fact, the default behavior of bundler effectively imposes ">=1.5" even though that's not what the Gemfile requires.
Is there any way, short of manually changing the Gemfile, that bundler can behave sensibly and just try to provide the latest version of the gem that it has the requirements for?
Update:
I agree that using ~> x.x.x
is the smart way to go, but it doesn't do the same thing as what I'm asking about. ~> x.x.x
specifically says "install just this version plus patches; do not go to x.x+1". But that is not the same as "give me the latest version that I can satisfy the dependencies for"