Skip to content

Instantly share code, notes, and snippets.

@nak1114
Last active June 19, 2023 08:44
Show Gist options
  • Save nak1114/7ea63204203883c5884d to your computer and use it in GitHub Desktop.
Save nak1114/7ea63204203883c5884d to your computer and use it in GitHub Desktop.
Batch for install rbenv-win (require windows Vista+)
@echo off
setlocal
rem Set your rbenv directry
set instpath="%USERPROFILE%\.rbenv-win"
rem Clone git repositry
call git clone https://github.com/nak1114/rbenv-win.git %instpath%
rem Config path
rem Add the bin & shims directory to your PATH environment variable for access to the rbenv command
rem get current PATH environment
for /f "skip=2 delims=" %%a in ('reg query HKCU\Environment /v Path') do set orgpath=%%a
rem update PATH environment
reg add HKCU\Environment /v Path /d "%instpath%\bin;%instpath%\shims;%orgpath:~22%" /f
setx RBENV_ROOT %instpath%
rem check new PATH environment
for /f "skip=2 delims=" %%a in ('reg query HKCU\Environment /v Path') do set orgpath=%%a
echo New PATH user local environment variable :"%orgpath:~22%"
echo.
rem Restart your shell
echo Please restart your shell
echo.
@Thecharmander95
Copy link

Wait do I put this in a file called that
Also, will it work for windows 10

@jaykilleen
Copy link

@dj967

Wait do I put this in a file called that
Also, will it work for windows 10

That is exactly what I did. Created a file called install-rbenv-win.bat then opened cmd and just ran that file. It has worked on a Windows 10 Server.

@MauricioTRP
Copy link

Anyone that can help me to add new ruby versions to this rbenv, or a way to uninstall it ?

@Abdullatifmuhaisen
Copy link

Anyone that can help me to add new ruby versions to this rbenv, or a way to uninstall it ?
watch this video

https://www.youtube.com/watch?v=WRolttrWKik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment