File tree 2 files changed +30
-4
lines changed
2 files changed +30
-4
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash -eu
2
+
3
+ echo " --- :ruby: Ruby environment info dump ${1:- } "
4
+
5
+ if [[ -f .ruby-version ]]; then
6
+ cat .ruby-version
7
+ else
8
+ echo ' Could not find .ruby-version in current folder'
9
+ fi
10
+
11
+ set -x # debug mode: print the commands we call
12
+
13
+ which ruby
14
+ ruby --version
15
+
16
+ which gem
17
+ gem --version
18
+
19
+ which bundle
20
+ gem list bundler
21
+ bundle version
22
+
23
+ set +x # exit debug mode
Original file line number Diff line number Diff line change @@ -7,10 +7,13 @@ CACHEKEY="$BUILDKITE_PIPELINE_SLUG-$ARCHITECTURE-ruby$RUBY_VERSION-$GEMFILE_HASH
7
7
8
8
restore_cache " $CACHEKEY "
9
9
10
- # Ensure we're using the latest version of Bundler before running bundle install.
11
- #
12
- # See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16 for more details on why this is recommended.
13
- gem install bundler
10
+ # Install the same Bundler version as the one in the Gemfile.lock.
11
+ # This should prevent runtime issues where Ruby "gets confused" on which Bundler version to use.
12
+ # See https://github.com/Automattic/bash-cache-buildkite-plugin/issues/16 for more details.
13
+ GEMFILE_LOCK_BUNDLER_VERSION=$( sed -n -e ' /BUNDLED WITH/{n;s/ *//p;}' Gemfile.lock)
14
+ # The command will fail if the `--version` parameter is empty; we can omit checking for that ourselves.
15
+ gem install bundler --version " $GEMFILE_LOCK_BUNDLER_VERSION "
16
+
14
17
bundle install
15
18
16
19
# If this is the first time we've seen this particular cache key, save it for the future
You can’t perform that action at this time.
0 commit comments