diff --git a/.gitignore b/.gitignore index 4db4e83235ccae..015835188e7b7b 100644 --- a/.gitignore +++ b/.gitignore @@ -105,6 +105,8 @@ package-lock.json # Ruby Gems (Bundler) /vendor /template/vendor +.ruby-version +/**/.ruby-version # iOS / CocoaPods /template/ios/build/ diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 49cdd668e1c82b..00000000000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.7.6 diff --git a/Gemfile b/Gemfile index 1642cc26ecaa56..cb9f3a332b0b1f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby File.read(File.join(__dir__, '.ruby-version')).strip +ruby ">= 2.6.10", "< 3.2.0" gem 'cocoapods', '~> 1.11', '>= 1.11.3' gem 'activesupport', '>= 6.1.7.1' diff --git a/scripts/update-ruby.sh b/scripts/update-ruby.sh index 2e8f39bb74be45..2f0975911925b6 100755 --- a/scripts/update-ruby.sh +++ b/scripts/update-ruby.sh @@ -32,23 +32,6 @@ fi if [ -z "$VERSION" ]; then die "Please provide an installed/usable Ruby version" fi -echo "Setting Ruby version to: $VERSION" - -cd "$ROOT" || die "Failed to change to $ROOT" - -# do this first, so rbenv/rvm will automatically pick the desired version -echo "$VERSION" > .ruby-version - -# make sure we're using it -CURRENT_VERSION=$(ruby --version | cut -d' ' -f2 | cut -dp -f1) -if [ -z "$CURRENT_VERSION" ]; then - # rbenv/rvm uses shims, the commands do exist, but do not return a version if misconfigured - die "Missing usable ruby, check your installation" -elif [ "$VERSION" != "$CURRENT_VERSION" ]; then - die "Plese use the ruby version you are trying to set: $VERSION ('$CURRENT_VERSION' in use)" -fi - -echo "$VERSION" > template/_ruby-version rm -f Gemfile.lock @@ -61,11 +44,9 @@ bundle lock export GIT_DISCOVERY_ACROSS_FILESYSTEM=1; IS_GIT_REPO=$(git rev-parse --is-inside-work-tree 2> /dev/null || true) export GIT_DISCOVERY_ACROSS_FILESYSTEM=0; + if [ "$IS_GIT_REPO" = "true" ]; then - git add \ - .ruby-version \ - Gemfile.lock \ - template/_ruby-version + git add Gemfile.lock else echo "Detected that you're not in Git. If on another SCM, don't forget to commit the edited files." fi diff --git a/template/Gemfile b/template/Gemfile index 567e59805c4a73..89f68756431a30 100644 --- a/template/Gemfile +++ b/template/Gemfile @@ -1,6 +1,6 @@ source 'https://rubygems.org' # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version -ruby File.read(File.join(__dir__, '.ruby-version')).strip +ruby ">= 2.6.10", "< 3.2.0" gem 'cocoapods', '~> 1.11', '>= 1.11.3' diff --git a/template/_ruby-version b/template/_ruby-version deleted file mode 100644 index 49cdd668e1c82b..00000000000000 --- a/template/_ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.7.6