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

Andrew Cantino 10 年之前
父节点
当前提交
6041746fb8
共有 1 个文件被更改,包括 7 次插入1 次删除
  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'