{"id":18319782,"url":"https://github.com/redding/rb","last_synced_at":"2025-07-01T23:06:39.809Z","repository":{"id":4732904,"uuid":"5881762","full_name":"redding/rb","owner":"redding","description":"Switch between installed Ruby versions.","archived":false,"fork":false,"pushed_at":"2024-04-18T23:43:31.000Z","size":72,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T03:45:19.951Z","etag":null,"topics":[],"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/redding.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2012-09-20T04:20:11.000Z","updated_at":"2024-04-18T23:43:34.000Z","dependencies_parsed_at":"2024-12-23T08:38:12.817Z","dependency_job_id":null,"html_url":"https://github.com/redding/rb","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/redding/rb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Frb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Frb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Frb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Frb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redding","download_url":"https://codeload.github.com/redding/rb/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Frb/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263047677,"owners_count":23405280,"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","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":[],"created_at":"2024-11-05T18:14:14.045Z","updated_at":"2025-07-01T23:06:39.771Z","avatar_url":"https://github.com/redding.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rb\n\nSwitch between installed Ruby versions.\n\n```\n$ rb @1.9.3 \u0026\u0026 ruby -v                           # activate '1.9.3' install\n$ echo 'ree' \u003e ./.ruby-version \u0026\u0026 rb \u0026\u0026 ruby -v  # activate current `.ruby-version` ('ree') install\n$ rb @system \u0026\u0026 ruby -v                          # activate system install\n$ rb help\n```\n\n## What It Does...\n\n**Modifies env vars:** switches versions by modifying the `PATH`, `GEM_HOME` and `GEM_PATH`\n  env vars.  To accomplish this, it...\n\n**Adds functions to your shell:** these are needed to modify shell env vars and are used to\n  activate and reset the env, and to implement the CLI.\n\n**.ruby-version files:** supports specifying versions with `.ruby-version` files.\n\n**Auto mode:** (optional) update the version when you `cd` to a directory containing a\n  `.ruby-version` file (does not hook `cd`).\n\n**Tab completions:** version string parameters, commands, etc.\n\n## Rubies\n\nEach installed version of ruby should live in `$HOME/.rubies/`.  Install versions any way you prefer; [ruby-build](https://github.com/sstephenson/ruby-build) is recommended.\n\n## Install\n\nOpen a terminal and run this command ([view source](http://git.io/rb--install)):\n\n(change PREFIX as needed; it defaults to `/usr/local`)\n\n```\n$ curl -L http://git.io/rb--install | PREFIX=/user/local sh\n```\n\n### Init\n\nAdd rb init to your shell startup script.  This installs tab completions and enables modifying the env vars.\n\n```bash\neval \"$(rb init)\"\n```\n\n### Auto Mode\n\n(optional) If you want automatic handling, add the `--auto` flag to the init.  In additon to the normal init above, `$PROMPT_COMMAND` is updated to activate any new ruby version as you change directories.  **Again, this is optional.**\n\n```bash\neval \"$(rb init --auto)\"\n```\n\n### Quiet Mode\n\nBy default, rb outputs a warning saying which version/source it activates. If you want to silence these warnings, add the `--quiet` flag to the init.\n\n```bash\neval \"$(rb init --quiet)\"\n```\n\n## Usage\n\n```\n$ rb help\n```\n\n### System Ruby\n\n```\n$ rb @system\n```\n\n### `.ruby-version` Files\n\nIf no explicit @\u003cverion\u003e parameter is specified, rb will look for the version in a file named `.ruby-version` in your current directory, its parent directories, or your home directory.  The `.ruby-version` files are expected to contain nothing but the version requested.\n\n```\n$ echo \"1.9.3-p0\" \u003e $HOME/.ruby-version\n$ cd $HOME \u0026\u0026 rb \u0026\u0026 ruby -v  # 1.9.3-p0\n```\n\nYou can specify a specific version file using the `-f` option:\n\n```\n$ cd $HOME\n$ echo 'ree-1.8.7-2012.02' \u003e /a/path/to/.ruby-version\n$ rb -f /a/path/to/.ruby-version\n$ ruby -v # will use ree-1.8.7-2012.02\n```\n\n**Note**: You can specify a \"default\" version file at `$HOME/.rubies/.ruby-version`.  This version will be used when no other .ruby-version can be found and no command line version has been specified.\n\n**Note**: If an `@\u003cversion\u003e` parameter is given, it will always override any versions specified in `.ruby-version` files.\n\n### Pow\n\nAdd a `.ruby-version` file to your project, as well as a `.powrc` file containing the following line (this will make Pow start up your project using the install in the version file):\n\n```bash\nsource `which rb` \u0026\u0026 rb @\n```\n\n## Uninstall\n\nOpen a terminal and run this command ([view source](http://git.io/rb--uninstall)):\n\n```\n$ curl -L http://git.io/rb--uninstall | sh\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredding%2Frb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredding%2Frb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredding%2Frb/lists"}