「Windows」パッケージ管理ツールscoopを使ってrubyをインストールする
環境
OS Windows 11 Pro 21H2 64bit
Windows PowerShell 管理者
操作方法
1.rubyインストール可能バージョンを確認します。
PS C:\Windows\system32> scoop search ruby Results from local buckets... Name Version Source Binaries ---- ------- ------ -------- jruby 9.3.6.0 main ruby 3.1.2-1 main
2.ruby「3.1.1-1」をインストールします。
PS C:\Windows\system32> scoop install ruby Installing 'ruby' (3.1.2-1) [64bit] from main bucket rubyinstaller-3.1.2-1-x64.7z (13.0 MB) [======================================================================] 100% Checking hash of rubyinstaller-3.1.2-1-x64.7z ... ok. Extracting rubyinstaller-3.1.2-1-x64.7z ... done. Linking ~\scoop\apps\ruby\current => ~\scoop\apps\ruby\3.1.2-1 Persisting gems Running post_install script... Fetching rake-13.0.6.gem Successfully installed rake-13.0.6 Parsing documentation for rake-13.0.6 Installing ri documentation for rake-13.0.6 Done installing documentation for rake after 3 seconds 1 gem installed 'ruby' (3.1.2-1) was installed successfully! Notes ----- Install MSYS2 via 'scoop install msys2' and then run 'ridk install' to install the toolchain! 'ruby' suggests installing 'msys2'.
3.「msys2」をインストールします。
PS C:\Windows\system32> scoop install msys2 中略 'msys2' (2022-06-03) was installed successfully! Notes ----- Please run 'msys2' now for the MSYS2 setup to complete!
4.msys2を起動します
PS C:\Windows\system32> msys2 user@arkgamepc MSYS /c/Windows/system32 # exit
5.ridkをインストールします。
PS C:\Windows\system32> ridk install _____ _ _____ _ _ _ ___ | __ \ | | |_ _| | | | | | |__ \ | |__) | _| |__ _ _ | | _ __ ___| |_ __ _| | | ___ _ __ ) | | _ / | | | '_ \| | | | | | | '_ \/ __| __/ _` | | |/ _ \ '__/ / | | \ \ |_| | |_) | |_| |_| |_| | | \__ \ || (_| | | | __/ | / /_ |_| \_\__,_|_.__/ \__, |_____|_| |_|___/\__\__,_|_|_|\___|_||____| __/ | _ |___/ _|_ _ __ | | o __ _| _ _ | (_) | |^| | | |(_|(_)\^/_> 1 - MSYS2 base installation 2 - MSYS2 system update (optional) 3 - MSYS2 and MINGW development toolchain Which components shall be installed? If unsure press ENTER [1,3] 1,3
6.rubyバージョンを確認します。
>ruby -v ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]