Workaround for installing correct version of ruby bundler

See https://github.com/bundler/bundler/issues/6870

Bundler 2.x dropped support for Ruby < 2.3 so now we detect ruby
version and install last known to work version. This means that
newer OS will get newer versions of bundler.

Change-Id: I521affb16d8d2312be3ff507a014adddacd6cb8b
Closes-Bug: #1810401
This commit is contained in:
Tobias Urdin 2019-01-16 00:17:34 +01:00
parent 909c6bc190
commit 2a1e10e9f0

View File

@ -7,7 +7,13 @@ prepare_environment() {
rm -rf puppet-whazz default-config.yaml
mkdir -p .bundled_gems
export GEM_HOME=`pwd`/.bundled_gems
gem install bundler --no-rdoc --no-ri --verbose
ruby <<EOF
cmd = 'gem install bundler --no-rdoc --no-ri --verbose'
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.3.0') then
cmd += ' -v 1.17.3'
end
system(cmd)
EOF
# Build fake module
OS_NEW_MODULE_TEST=yes bash -x ./contrib/bootstrap.sh whazz dummy