17492: Clean up bundler version check/install.
authorTom Clegg <tom@curii.com>
Tue, 8 Feb 2022 19:09:16 +0000 (14:09 -0500)
committerTom Clegg <tom@curii.com>
Tue, 8 Feb 2022 19:09:16 +0000 (14:09 -0500)
Apparently gem installs bundler in $HOME, not in $GEM_HOME like we
expected.  The broken code continued working as long as it was using a
pre-existing run-tests temp dir that also installed a version of
bundler in $GEM_HOME because bundler was listed in a Gemfile.lock.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

build/run-tests.sh

index 9cd38784b96ec9ad2949da343950f5d5e9961597..f716cb35f2009f2b2d6543a168b160695dd3ebd2 100755 (executable)
@@ -544,13 +544,12 @@ setup_ruby_environment() {
         echo "Will install dependencies to $(gem env gemdir)"
         echo "Will install bundler and arvados gems to $tmpdir_gem_home"
         echo "Gem search path is GEM_PATH=$GEM_PATH"
-        bundle="$tmpdir_gem_home/bin/bundle"
+        bundle="bundle"
         (
             export HOME=$GEMHOME
-            bundlers="$(gem list --details bundler)"
             versions=(2.2.19)
             for v in ${versions[@]}; do
-                if ! echo "$bundlers" | fgrep -q "($v)"; then
+                if ! gem list --installed --version "${v}" bundler >/dev/null; then
                     gem install --no-document --user $(for v in ${versions[@]}; do echo bundler:${v}; done)
                     break
                 fi