diff --git a/bin/bundle b/bin/bundle index d2e5081..17db3f0 100755 --- a/bin/bundle +++ b/bin/bundle @@ -1,9 +1,14 @@ #!/usr/bin/env ruby # Check if an older version of bundler is installed +mybasedir = __FILE__.gsub(/\/bin\/bundle/, '') + require 'bundler' $:.each do |path| - if path =~ %r'/bundler-0.(\d+)' && $1.to_i < 9 + # ignore the directory we're running from, in the tests + path = path.gsub(%r"^#{mybasedir}", '') + + if path =~ %r'/bundler-0\.(\d+)' && $1.to_i < 9 abort "Please remove older versions of bundler. This can be done by running `gem cleanup bundler`." end end