How to install ruby 3.4.3 in wsl ubuntu?
How to install ruby 3.4.3 in wsl ubuntu?
To install Ruby in Windows Subsystem for Linux (WSL), the recommended method is to use a version manager like rbenv. This allows you to easily switch between different Ruby versions for various projects.
Step-by-Step Installation with rbenv
Open your WSL terminal (e.g., Ubuntu) and follow these steps:
- Update your package list and install necessary dependencies:
- Install rbenv by cloning the repository from GitHub and adding it to your shell's PATH:
- Note: If you are using a different shell like Zsh, replace
~/.bashrcwith~/.zshrc.
- Note: If you are using a different shell like Zsh, replace
- Install the ruby-build plugin, which provides the
rbenv installcommand: - Restart your terminal by closing the current window and opening a new one to ensure the changes to your shell take effect.
- Install Ruby:
- List all available Ruby versions using
rbenv install -l. - Install the desired version (e.g.,
3.3.4, a recent stable version):
- List all available Ruby versions using
- Set the global Ruby version to the one you just installed:
- Verify the installation by checking the Ruby version:You should see the installed version, e.g.,
ruby 3.3.4 (2024-08-09 revision e51014f9c0) [x86_64-linux]. - (Optional) Install Bundler, a crucial gem for managing project dependencies:
0 Comments
If you have any doubts or any topics that you want to know more about them please let me know