Installing system packages
IMPORTANT NOTE: From here on we will be executing all the commands in the WSL shell and not the Windows shells like Powershell or CMD. The WSL shell is the Ubuntu terminal in our case.
To get started with Ruby on Rails, first we need to install all the dependent system packages on the WSL. For this execute the following command within the WSL shell:
Installing zsh
We will be using ZSH as our default shell. To install and set ZSH as our default shell, follow these steps:
After the installation is complete, we need to configure zsh in our system. For the time being we will use the default configuration and build upon that. To do this execute this command on the shell:
You will be greeted with this message:
Here select option 2
which will create a .zshrc
file in your home directory with the default configuration. This would be a good time to restart our terminal so that all the new changes are in effect properly.
Now that we have installed ZSH, we need to configure ZSH to be our default shell. To do this execute the following command in a new WSL shell:
Now quit and reopen your WSL terminal. You should see the ZSH shell now. But just to confirm that zsh is now you default shell, execute:
If you get the result /user/bin/zsh
as your response, then that means, you have successfully installed and set ZSH as your default shell.
Setting up Oh my ZSH(OMZ) [Optional]
Oh My Zsh(OMZ) is a delightful, open source, community-driven framework for managing your Zsh configuration.
It comes bundled with thousands of helpful functions, helpers, plugins, themes, and other goodies that will make you say Oh My ...!.
To install OMZ do the following steps:
Once completed, you should get a similar output:
Now lets add the OMZ plugins that will be useful to us in the .zshrc
file. To do this, you can make use of your desired text editor like VSCode or Vi. Use the following commands to edit the text file:
Now add this line to the top of your .zshrc
file:
Your file should look something like this:
Once completed, save the file and restart your shell by using this command:
Doing this will auto-install all the specified plugins.