File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,14 +16,22 @@ check "rails" rails --version
1616check " rails installation path" gem which rails
1717check " user has write permission to rvm gems" [ -w /usr/local/rvm/gems ]
1818check " user has write permission to rvm gems default" [ -w /usr/local/rvm/gems/default ]
19- # Check if we can reach rubygems.org before proceeding.
20- # This uses curl to silently (-s) make a request to https://rubygems.org
21- # Redirects output to /dev/null because we only care if the request succeeds, not the result itself.
22- if ! curl -s https://rubygems.org > /dev/null; then
23- echo " Network access to rubygems.org is unavailable. Please check network or proxy settings."
24- exit 1
19+
20+ # This section verifies connectivity to rubygems.org and attempts to install a gem if reachable.
21+ can_reach_rubygems=false
22+ for i in 1 2 3 4 5; do
23+ if curl -fsSL --connect-timeout 10 --max-time 20 https://rubygems.org/ > /dev/null; then
24+ can_reach_rubygems=true
25+ break
26+ fi
27+ sleep $(( i * 2 ))
28+ done
29+
30+ if [ " ${can_reach_rubygems} " = " true" ]; then
31+ check " user can install gems" gem install --no-document github-markup
32+ else
33+ echo " WARN: Could not reach rubygems.org after retries; skipping gem install check."
2534fi
26- check " user can install gems" gem install github-markup
2735
2836# Report result
2937reportResults
You can’t perform that action at this time.
0 commit comments