{"id":31250569,"url":"https://github.com/alextheberge/reset-macruby","last_synced_at":"2025-10-10T19:09:00.888Z","repository":{"id":310062105,"uuid":"1038561661","full_name":"alextheberge/reset-macruby","owner":"alextheberge","description":"Tired of Ruby misbehaving, bash it.","archived":false,"fork":false,"pushed_at":"2025-08-15T13:15:53.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-15T14:48:01.278Z","etag":null,"topics":["macos","ruby","ruby-lib","rubygems"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alextheberge.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-15T12:37:19.000Z","updated_at":"2025-08-15T13:21:16.000Z","dependencies_parsed_at":"2025-08-15T14:48:04.046Z","dependency_job_id":"3f895422-e8d4-47cb-9dde-cd7c80851f1f","html_url":"https://github.com/alextheberge/reset-macruby","commit_stats":null,"previous_names":["alextheberge/reset-macruby"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alextheberge/reset-macruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextheberge%2Freset-macruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextheberge%2Freset-macruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextheberge%2Freset-macruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextheberge%2Freset-macruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alextheberge","download_url":"https://codeload.github.com/alextheberge/reset-macruby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alextheberge%2Freset-macruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276519129,"owners_count":25656556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["macos","ruby","ruby-lib","rubygems"],"created_at":"2025-09-23T05:31:00.576Z","updated_at":"2025-09-23T05:31:58.027Z","avatar_url":"https://github.com/alextheberge.png","language":"Shell","readme":"# macOS Ruby Environment Reset Script\n\n**Version:** 2.6.0\\\n**Supported OS:** **macOS only** (Darwin)\\\n**Shell Compatibility:** Bash 3.2+ (default on macOS)\n\n---\n\n## TL;DR\n\nThis script **resets your Ruby environment to the default system Ruby on macOS**. It:\n\n- Detects and **attempts** to remove version managers (`rbenv`, `rvm`, `asdf`)\n- Removes all **non-system Ruby versions** and associated gems\n- Cleans up **shell init files** and lingering Ruby paths\n- Removes `.ruby-version` / `.tool-versions` files\n- Cleans stale Homebrew taps (optional)\n- Provides a **post-run audit** with instructions if anything remains\n\n**⚠️ This script is for macOS only. Running it on other systems may break your Ruby environment.**\n\n---\n\n## Quick Examples\n\n### Interactive cleanup\n\n```bash\nbash ./reset-macruby.sh\n```\n\n- Lists detected managers and Ruby installs\n- Prompts before removal\n\n### Full automation\n\n```bash\nbash ./reset-macruby.sh --full-reset\n```\n\n- Removes all Ruby installs, managers, gems, caches, and shell init entries\n- Cleans Homebrew stale taps\n- Shows post-run audit\n\n### Skip removing version managers\n\n```bash\nbash ./reset-macruby.sh --full-reset --keep-managers\n```\n\n- Resets Ruby versions and gems but keeps `rbenv`, `rvm`, and `asdf`\n\n### Dry run (preview actions)\n\n```bash\nbash ./reset-macruby.sh --dry-run\n```\n\n- Shows exactly what would happen without making changes\n\n---\n\n## Flags\n\n| Flag                   | Description                                                                                                                                                 |\n| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `--dry-run`            | Show what actions would be taken without making changes                                                                                                     |\n| `--full-reset`         | Remove all detected Ruby installs, attempt to remove managers, scrub shell files, clear caches, purge `.ruby-version` files, and untap stale Homebrew repos |\n| `--keep-managers`      | Skip removal of `rbenv`, `rvm`, and `asdf` even if detected                                                                                                 |\n| `--purge-ruby-version` | Automatically remove `.ruby-version` files without prompting                                                                                                |\n\n---\n\n## Post-Run Audit\n\nAfter running, the script will show:\n\n- Remaining version managers\n- Their locations and binary paths\n- Shell init file references\n- Exact manual removal steps\n\n**Example:**\n\n```text\n⚠️  rbenv still detected:\n   • binary on PATH: /opt/homebrew/bin/rbenv\n   • Homebrew formula: rbenv (installed)\n   • user directory: /Users/alex/.rbenv\n   • init lines in:\n     /Users/alex/.zprofile:8:eval \"$(rbenv init - --no-rehash zsh)\"\n   → Suggested removal steps:\n     - brew uninstall rbenv ruby-build\n     - rm -rf \"/Users/alex/.rbenv\"\n     - sed -i '' -E '#rbenv#d' ~/.zshrc ~/.zprofile ~/.bashrc ~/.bash_profile\n     - sed -i '' -E '#/\\.rbenv/shims#d' ~/.zshrc ~/.zprofile ~/.bashrc ~/.bash_profile\n     - exec $SHELL\n```\n\n---\n\n## What This Script Removes\n\n- **Ruby installs**: rbenv, rvm, asdf, Homebrew, standalone\n- **Gem caches**: `~/.gem`, `~/.bundle`, `~/.cache/bundler`, `~/.rvm/gems`, `~/.rvm/gemsets`, `~/Library/Caches/ruby-build`\n- **Manager directories**: `~/.rbenv`, `~/.rvm`, `~/.asdf`\n- **Homebrew packages**: `rbenv`, `ruby-build`, `asdf`\n- **Shell init lines** referencing managers\n- `.ruby-version` and `.tool-versions` entries\n\n---\n\n## Notes\n\n- Always restart your shell or run `exec $SHELL` after changes\n- To check your Ruby version after reset:\n\n```bash\nwhich ruby \u0026\u0026 ruby -v\n```\n\n- You should see `/usr/bin/ruby` for macOS system Ruby\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextheberge%2Freset-macruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falextheberge%2Freset-macruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falextheberge%2Freset-macruby/lists"}