Skip to content

Commit c7be7f9

Browse files
committed
(maint) Update acceptance to fix windows ruby install
A couple things have changed about ruby and chocolatey, requiring new changes to ensure the windows installation can succeed. The newest versions of chocolately no longer require the `--lo` flag in the choco list command, because that command now only lists local packages instead of doing any remote searching. Remove use of the flag so acceptance setup can complete Update the ruby installation to use latest ruby, version 2.5 was unable to build with new changes to the ruby devkit. Add new steps to install msys2 and run ridk to install the ruby devkit, which is required to build gems with C extensions
1 parent 7a10680 commit c7be7f9

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

acceptance/setup/common/pre-suite/010_install_ruby.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@
1313
# HACK: to add chocolatey path to cygwin: this path should at least be
1414
# instrospected from the STDOUT of the installer.
1515
bolt.add_env_var('PATH', '/cygdrive/c/ProgramData/chocolatey/bin:PATH')
16-
on(bolt, powershell('choco install ruby -y --version 2.5.3.101'))
17-
on(bolt, powershell('choco list --lo ruby')) do |output|
18-
version = /ruby (2\.[0-9])/.match(output.stdout)[1].delete('.')
16+
on(bolt, powershell('choco install ruby -y'))
17+
on(bolt, powershell('choco list ruby')) do |output|
18+
version = /ruby ([2-3]\.[0-9])/.match(output.stdout)[1].delete('.')
1919
bolt.add_env_var('PATH', "/cygdrive/c/tools/ruby#{version}/bin:PATH")
2020
end
21+
# The ruby devkit (required to build gems with C extensions) has changed,
22+
# and we now need to install msys2 ourselves. https://community.chocolatey.org/packages/msys2
23+
on(bolt, powershell('choco install msys2 -y --params "/NoUpdate"'))
24+
on(bolt, powershell('ridk install 2 3'))
25+
# Add the msys bins to PATH
26+
bolt.add_env_var('PATH', "/cygdrive/c/tools/msys64:PATH")
2127
# public_suffix for win requires Ruby version >= 2.6
2228
# current Ruby 2.5.0 works with public_suffix version 4.0.7
2329
on(bolt, powershell('gem install public_suffix -v 4.0.7'))

0 commit comments

Comments
 (0)