add an error when bundling if bundler is older than version 1.5

Andrew Cantino 10 lat temu
rodzic
commit
6041746fb8
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      Gemfile

+ 7 - 1
Gemfile

@@ -1,6 +1,12 @@
1 1
 source 'https://rubygems.org'
2 2
 
3
-# bundler <1.5 does not recognize :x64_mingw as a valid platform name
3
+# Bundler <1.5 does not recognize :x64_mingw as a valid platform name.
4
+# Unfortunately, it can't self-update because it errors when encountering :x64_mingw.
5
+unless Gem::Version.new(Bundler::VERSION) >= Gem::Version.new('1.5.0')
6
+  STDERR.puts "Bundler >=1.5.0 is required.  Please upgrade bundler with 'gem install bundler'"
7
+  exit 1
8
+end
9
+
4 10
 gem 'bundler', '>= 1.5.0'
5 11
 
6 12
 gem 'protected_attributes', '~>1.0.7'