2

Is there a way to specify a below X or above Y (if available) for a gem via Bundler?

For example I'd like to do something like this, but not sure of the syntax and can't find any examples:

gem 'nokogiri', '<= 1.6.3.1', '>= 1.6.7'

Variations on this don't work:

gem 'nokogiri', '<= 1.6.3.1 || >= 1.6.7'

Nokogiri 1.6.7 isn't released yet but a patch was accepted months ago that fixes a bug that exists in 1.6.4 - 1.6.6.

So I'd like to tell my Gemfile to use 1.6.3.1 (the last stable version for me) until 1.6.7 is released. If only as a reminder to my team, after months have gone by, that we're waiting on 1.6.7.

Is this possible?

Meltemi
  • 37,979
  • 50
  • 195
  • 293
  • 2
    It should be noted that OP isn't trying to include a range of versions, but rather exclude them, allowing any earlier OR later versions to be installed using bundler. This use-case is not in the documentation for bundler (perhaps those suggesting to read the docs should check themselves.) – sjagr Aug 26 '15 at 18:58

1 Answers1

0

You can use the != notation to exclude any specific versions

gem 'nokogiri', '~>1.6', '!=1.6.4.0', '!=1.6.4.1', '!=1.6.4.2', # and so on...

but this is clearly silly as you'd have to list every minor version to exclude. It doesn't work if you list !=1.6.4. Unfortunately I can't find any alternatives yet.

sjagr
  • 15,983
  • 5
  • 40
  • 67