{"id":26455413,"url":"https://github.com/rubymetric/rbenv-for-windows","last_synced_at":"2025-04-09T05:12:19.816Z","repository":{"id":39879939,"uuid":"487679584","full_name":"RubyMetric/rbenv-for-windows","owner":"RubyMetric","description":"rbenv for Windows - Manage your app's Ruby environment on Windows","archived":false,"fork":false,"pushed_at":"2025-03-08T23:23:03.000Z","size":464,"stargazers_count":139,"open_issues_count":6,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-02T02:11:39.261Z","etag":null,"topics":["rbenv","rubyinstaller"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","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/RubyMetric.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"custom":["https://github.com/ccmywish/support-my-oss-work"]}},"created_at":"2022-05-02T01:02:33.000Z","updated_at":"2025-04-01T01:16:31.000Z","dependencies_parsed_at":"2024-01-02T13:24:10.777Z","dependency_job_id":"4389b98c-44fc-41ac-99f5-7daa1f6640cf","html_url":"https://github.com/RubyMetric/rbenv-for-windows","commit_stats":null,"previous_names":["rubymetric/rbenv-for-windows"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frbenv-for-windows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frbenv-for-windows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frbenv-for-windows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubyMetric%2Frbenv-for-windows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubyMetric","download_url":"https://codeload.github.com/RubyMetric/rbenv-for-windows/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980844,"owners_count":21027808,"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":["rbenv","rubyinstaller"],"created_at":"2025-03-18T20:51:48.676Z","updated_at":"2025-04-09T05:12:19.800Z","avatar_url":"https://github.com/RubyMetric.png","language":"PowerShell","funding_links":["https://github.com/ccmywish/support-my-oss-work"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003ch1 align=\"center\"\u003erbenv for Windows\u003c/h1\u003e\n\n\u003cp\u003e\n\n\u003ca href=\"https://github.com/RubyMetric/rbenv-for-windows/blob/main/LICENSE.txt\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/RubyMetric/rbenv-for-windows.svg\" alt=\"License\" /\u003e\n\u003c/a\u003e\n\n\u003c/p\u003e\n\nManage multiple Rubies on Windows.\n\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n嗨, 你好\n\nHi, hello\n\n`rbenv for Windows` is a [rbenv] clone for Ruby users on Windows. After continuous improvements, It now can\n1. Handle `rbenv local` well\n2. Integrate with `RubyGems`, `Bundler` compactly\n3. Interact with shell prompt tools like [starship] and [oh-my-posh] properly\n\nThere's a simple [record](./doc/benchmark.md) to show if `rbenv` will influence Ruby/Gem commands startup time significantly.\n\n\u003cbr\u003e\n\n## Screenshot\n\n![screenshot](image/screenshot.png)\n\n\u003cbr\u003e\n\n## Install\n\n### Requirements\n\n- Windows 7 SP1+ / Windows Server 2008+\n- [PowerShell 5](https://aka.ms/wmf5download) (or later, include [PowerShell Core](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-windows?view=powershell-6)) and [.NET Framework 4.5](https://www.microsoft.com/net/download) (or later)\n\n    PowerShell must be enabled for your user account e.g.\n    ```powershell\n    Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\n    ```\n\n- cURL\n- Git\n- 7zip\n\n\u003cbr\u003e\n\n### Install Guides\n\n\u003e [!TIP]\n\u003e **It's portable, be bold to try it now**\n\n\u003cdetails\u003e\n\u003csummary\u003eFor common users\u003c/summary\u003e\n\nFirst, input and run these commands in your terminal:\n\n```PowerShell\n# Customize the location you want to install to,\n# preferably without spaces, as it has not been tested\n$env:RBENV_ROOT = \"C:\\Ruby-on-Windows\"\niwr -useb \"https://github.com/RubyMetric/rbenv-for-windows/raw/main/tool/install.ps1\" | iex\n```\n\nThen, in your `$profile`, you should add theses:\n\n```PowerShell\n# rbenv for Windows\n$env:RBENV_ROOT = \"C:\\Ruby-on-Windows\"\n\n# Not easy to download on Github?\n# Use a custom mirror!\n# $env:RBENV_USE_MIRROR = \"https://abc.com/abc-\u003cversion\u003e\"\n\n\u0026 \"$env:RBENV_ROOT\\rbenv\\bin\\rbenv.ps1\" init\n```\nAfter adding these configurations to your $profile `notepad.exe $profile`, restart your terminal for the changes to take effect.\n\nTo update, use the following command:\n\n```PowerShell\nrbenv update\n```\n\nNote that, this tool is still under active development, if you've encountered some error, UPDATE FIRST!\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFor Chinese users\u003c/summary\u003e\n\n中国大陆用户请使用以下方式，通过Gitee避免网络问题，以及使用内置CN镜像。\n\n首先，在你的终端中输入并运行以下命令:\n\n```PowerShell\n# 自定义你想安装到的位置，最好不要有空格，因为没有测试过\n$env:RBENV_ROOT = \"C:\\Ruby-on-Windows\"\n$s = (iwr -useb \"https://gitee.com/RubyMetric/rbenv-for-windows/raw/main/tool/install.ps1\")\nicm -sc ([scriptblock]::Create($s.Content)) -arg \"install\", \"cn\"\n```\n\n其次，在你的 `$profile` `notepad.exe $profile` 中, 添加这些内容:\n\n```PowerShell\n# rbenv for Windows\n$env:RBENV_ROOT = \"C:\\Ruby-on-Windows\"\n\n# 我为大陆用户预置了镜像, 请查看 share/mirrors.ps1\n# 请注意，这个必须放在 'init' 之前\n$env:RBENV_USE_MIRROR = \"CN\"\n\n\u0026 \"$env:RBENV_ROOT\\rbenv\\bin\\rbenv.ps1\" init\n```\n\n更新请使用以下命令\n\n```PowerShell\nrbenv update cn\n```\n\n请注意，此工具仍在积极开发中，如果您遇到了一些错误，请先更新!\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eFor Russian users\u003c/summary\u003e\n\nYou can refer to this article by [@SKOLIA0](https://github.com/SKOLIA0)\n\nВы можете обратиться к этой статье [@SKOLIA0](https://github.com/SKOLIA0)\n\nhttps://github.com/SKOLIA0/rbenv-for-windows/blob/main/README_RU.md\n\n\u003c/details\u003e\n\n\u003cbr\u003e\n\n## Usage\n\n**Note:** You can omit many numbers when you specify a version!\n\nTry use\n- `rbenv global 3`\n- `rbenv local 2.`\n- `rbenv install 3.1`\n\n```PowerShell\n# List recent Ruby versions\nrbenv install -l\n\n# List all Ruby versions\nrbenv install -a\n\n# Hooray! So easy to try Ruby dev branch!\nrbenv install head\n\n# Install Ruby 3.1.2-1\nrbenv install 3.1.2\n\nrbenv install 3.0.0-1\n\n# Install devkit\n\n# No need to run it by yourself now,\n# It will run automatically when first setup rbenv\nrbenv install msys\n# or\nrbenv install msys2\n# or\nrbenv install devkit\n\n# List all installed versions\nrbenv versions\n\n# Set global version\nrbenv global 3.0.0-1\n# Check global version\nrbenv global\n\n# Set local version\nrbenv local 3.1.2-1\n\n# Check versions\nrbenv versions\n\n# Set Ruby version in this shell\nrbenv shell 3.0.0-1\n\n# Show current version\nrbenv version\n\n# Unset Ruby version in this shell\nrbenv shell --unset\n\nrbenv uninstall 3.1.2\n\n# Update rbenv itself!\nrbenv update\n```\n\n**Note:**\n\nFrom `3.1.0-1`, we should download `rubyinstaller-\u003cversion\u003e.7z` directly, no devkit. That's only about 15MB. **Every Ruby shares one MSYS64.**\n\nHowever, before `3.1.0-1`, we have to download `rubyinstaller-devkit-\u003cversion\u003e.7z`, with devkit. That's about 130MB ... **Every Ruby has their own MSYS64.**\n\n\u003cbr\u003e\n\n## Known issues\n\n**The current implementation has these drawbacks and issues:**\n\n1. We only support CRuby, x64 versions, provided by RubyInstaller2\n\n    Sorry for that I have no plan to add x86 versions and other Ruby implementations like mruby, JRuby, TruffleRuby and so on. If you want to support it, consider to be a maintainer please! Thank you!\n\n2. We don't support old versions that have a little different leading URL\n\n    Very small URL changes will make our work double, I don't have time for it. So keep URLs convention stable is very important. Luckily, these exceptions are very old Ruby versions (part of 2.4, 2.5 series) built by RubyInstaller, don't worry! See [share/README.md](./share/README.md) for details.\n\n\u003cbr\u003e\n\n\u003ca id=\"EnvVar\"\u003e \u003c/a\u003e\n## Environment Variables\n\n### rbenv user defined\n\nname | example | description\n-----|---------|------------\n`$env:RBENV_ROOT` | e.g.: `C:\\Ruby-on-Windows` | Defines the directory under which MSYS2, Ruby versions, shims and rbenv itself reside.\n`$env:RBENV_USE_MIRROR` | e.g.: `\"CN\"` | Defines the mirror site for download links.\n\n### rbenv auto defined\n\nname | init value | description\n-----|---------|------------\n`$env:RBENV_INIT` | 1 | To avoid double init. **This variable is set automatically when your terminal start, not set yourself!**\n`$env:RUBYLIB` | `$env:RBENV_ROOT\\rbenv\\share` | For RubyGems plugin to work. **This variable is set automatically when your terminal start, not set yourself!**\n`$env:RBENV_SYSTEM_RUBY` | `3.1.2-1\u003c=\u003eC:\\Ruby31-x64\\` | **This variable is set automatically when your terminal start, not set yourself!** No this if you don't have a Ruby installed by RubyInstaller GUI\n\n### rbenv commands defined\n\nname | example | description\n-----|---------|------------\n`$env:RBENV_VERSION` | 3.2.0 | Specifies the Ruby version to be used in a shell. \u003cbr\u003e **This variable is set by command `rbenv shell`, not manually!**\n\n\u003cbr\u003e\n\n## Thanks\n\n1. I reuse a lot of code pieces from [scoop](https://github.com/ScoopInstaller/Scoop)\n2. The [RubyInstaller2] builds Ruby on Windows day and night\n3. The [rbenv] is our role model\n\n\u003cbr\u003e\n\n[RubyInstaller2]: https://github.com/oneclick/rubyinstaller2\n[rbenv]: https://github.com/rbenv/rbenv\n[starship]: https://github.com/starship/starship\n[oh-my-posh]: https://github.com/JanDeDobbeleer/oh-my-posh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubymetric%2Frbenv-for-windows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubymetric%2Frbenv-for-windows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubymetric%2Frbenv-for-windows/lists"}