Skip to content

Commit 534bf08

Browse files
committed
Use gem update --system to update rubygems on Windows
Previously, the student was required to download a package and install it with `update_rubygems` Fixes railsbridge#596
1 parent 1b31c8f commit 534bf08

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

lib/site_extensions/installfest.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ def version_string(name)
66
'2.3'
77
when :windows_rubygems_min
88
'2.6.7'
9-
when :windows_rubygems_current
10-
'2.6.8'
9+
when :windows_rubygems_min_short
10+
'2.6'
1111
else
1212
raise StandardError, "No version string exists for '#{name}'"
1313
end

sites/en/installfest/windows.step

+6-17
Original file line numberDiff line numberDiff line change
@@ -83,36 +83,25 @@ step "Open a Terminal" do
8383
end
8484

8585
step "Update RubyGems" do
86-
message "The version of RubyGems that comes with RailsInstaller has some problems. Follow these steps to upgrade it!"
86+
message "The version of RubyGems that comes with RailsInstaller may be outdated. Follow these steps to upgrade it!"
8787

8888
step "Check to see if you need to update" do
8989
console "gem -v"
9090

91-
message "If the output is **2.6.6** or earlier, keep following the instructions."
92-
9391
message "If the output is **#{version_string(:windows_rubygems_min)}** or later, <a href='#install-node'>skip to the next step!</a>"
9492
end
9593

96-
step "Download the update" do
97-
message "Visit https://rubygems.org/downloads/rubygems-update-#{version_string(:windows_rubygems_current)}.gem"
98-
99-
message "**Right click -> Save target as...** the file **rubygems-update-#{version_string(:windows_rubygems_current)}.gem** to your **C:\\Sites** directory"
100-
end
101-
102-
step "Install the update" do
103-
message "Back at the command prompt, run the following commands:"
104-
105-
console_without_message "gem install --local C:\\Sites\\rubygems-update-#{version_string(:windows_rubygems_current)}.gem"
94+
step "Install the latest version of RubyGems" do
95+
message "Otherwise, run the following command:"
10696

107-
console_without_message "update_rubygems --no-document"
97+
console_without_message "gem update --system --no-document"
10898

10999
message "**Close and reopen your command prompt**, then verify you have the upgraded RubyGems by typing this in the terminal:"
110100

111101
console_without_message "gem -v"
112-
result version_string(:windows_rubygems_current)
102+
fuzzy_result "#{version_string(:windows_rubygems_min_short)}{FUZZY}.9{/FUZZY}"
113103

114-
message "Finally, you can clean up by running the following command:"
115-
console_without_message "gem uninstall rubygems-update -x"
104+
message "As long as the version is at least **#{version_string(:windows_rubygems_min)}**, you should be fine!"
116105
end
117106
end
118107

0 commit comments

Comments
 (0)