Skip to content

Commit

Permalink
Merge pull request #1249 from Shopify/st0012-fix-ruby-3.2-build
Browse files Browse the repository at this point in the history
Avoid installing prerelease bundler for mock project
  • Loading branch information
st0012 authored Oct 27, 2022
2 parents 50e65d7 + 1b96da0 commit 1c7862f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions spec/helpers/mock_project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,18 @@ def bundle_install(version: nil)
opts = {}
opts[:chdir] = path
Bundler.with_unbundled_env do
::Gem.install("bundler", bundler_version)
out, err, status = Open3.capture3(["bundle", "_#{bundler_version}_", "install"].join(" "), opts)
cmd =
# prerelease versions are not always available on rubygems.org
# so in this case, we install whichever is the latest
if ::Gem::Version.new(bundler_version).prerelease?
::Gem.install("bundler")
"bundle install"
else
::Gem.install("bundler", bundler_version)
"bundle _#{bundler_version}_ install"
end

out, err, status = Open3.capture3(cmd, opts)
ExecResult.new(out: out, err: err, status: T.must(status.success?))
end
end
Expand Down

0 comments on commit 1c7862f

Please sign in to comment.