Skip to content

Instantly share code, notes, and snippets.

@skull-squadron
Last active October 28, 2024 10:58
Show Gist options
  • Save skull-squadron/43a5b69037278e6075674b37bd485bb6 to your computer and use it in GitHub Desktop.
Save skull-squadron/43a5b69037278e6075674b37bd485bb6 to your computer and use it in GitHub Desktop.
HACK Fix ruby 3.3.5 annoyance
#!/usr/bin/env bash
set -eEuo pipefail
# https://stackoverflow.com/questions/79015158/why-is-gem-clean-reporting-multiple-ambiguous-references-to-the-default-psych
# https://stackoverflow.com/q/79015158
targets() {
find "$(gem env home)"/specifications/default -name 'rdoc-*.gemspec'
}
readarray -t files < <(targets)
for file in "${files[@]}"; do
grep -q '%q<psych>.*4' "$file" || continue
cp "$file" "$file.bak"
sed '/%q<psych>.*4/d' "$file.bak" > "$file"
echo >&2 "Patched $file and saved a backup as $file.bak"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment