Version specific gem :platform in Gemfile doesn't do anything that I can see #4420
Comments
There's no way to do this -- you'll need to stick with 10.x for 1.8 compatibility. |
What is the intended use case for the version specific platform identifiers? The docs indicate that it does constrain the ruby version http://bundler.io/v1.11/man/gemfile.5.html#PLATFORMS-platforms- |
Yes, they do, but a single bundle must be self-coherent, regardless of different groups, platform blocks, install_if blocks, etc |
So as far as I can tell, this is best interpreted as a feature request to allow Bundler to have different versions of the same gem on different platforms? cc @kjg |
If that's the feature request, we can close this -- that's simply not in the cards. It goes completely against bundler's promise of installing the same dependencies everywhere. If this functionality is something the user wants, they will have to use a regular ruby conditional and deal with the fact that their lockfile with change every time that they switch ruby versions |
Gems inside the |
@kjg I confirm that. The following blocks are enforced with all Ruby versions: platforms :ruby_18 do
# https://github.com/rspec/rspec-core/issues/1864
gem 'rspec', '< 3.2.0', :require => false
gem 'rake', '< 11.0.0', :require => false
end
platforms :ruby_18, :ruby_19 do
gem 'json', '< 2.0.0', :require => false
gem 'json_pure', '< 2.0.0', :require => false
end |
Closing, this is how the |
Running Bundler Version 1.11.2
If I have a Gemfile that specifies
I get the error
Am I just missing the point of the version specific platform option on the gems?
Is there anyway to meet this use case of installing a different version of the gem depending on the version of ruby?
Even though rake specifies it's REQUIRED RUBY VERSION in it's gemfile, bundler still tries to install >11 when I'm on ruby 1.8.7 for example, so using
platforms :ruby_20
is what I'd expect to have to do to work around this, but that doesn't seem to work either.The text was updated successfully, but these errors were encountered: