visit
It's not as bad anymore...Today, there’s no reason someone couldn’t write Ruby code on Windows. Different toolchains or not. Since most of the web is Linux based, it is a very good practice to pitch the development environment to be as close as possible to the production environment. Fortunately for us, Microsoft gave us the gift of WSL (Windows Subsystem for Linux). This article will show the two ways you can install Ruby and Rails on Windows.
After enabling Ubuntu (WSL). (Need help? ). You can open Bash and then, for starters - update out bash to the latest version
sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt clean
After that - you can proceed to install ruby with sudo apt-get update && sudo apt-get install ruby-full
sudo apt install build-essential patch ruby-dev zlib1g-dev liblzma-dev libsqlite3-dev nodejs
After the ruby install you can proceed to install the rails gemgem install rails
With that, you will be done! And you will then proceed to set up your environment with WSL. WSL (by default) does not have an actual directory that you can easily reach out to- for that we have to change the default directory for the bash shell so that its easier to navigate to in windows. I propose the C Drive! I'm naming my code folder to Github. ;)cd ~
edit .bashrc
That will open the .bashrc file. Scroll down and change
cd ~
to cd /mnt/c/<your-dir-name>
sudo sh -c "echo 'deb //apt.postgresql.org/pub/repos/apt/ focal-pgdg main' > /etc/apt/sources.list.d/pgdg.list"
wget --quiet -O -
//apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common
sudo apt-get install postgresql-9.5 libpq-dev
service postgresql start
sudo -u postgres createuser yourusernamehere -s
sudo -u postgres psql
## When psql runs, type '\password yourusernamehere' then enter password when prompted.
postgres=# \password yourusernamehere
## Ctl+z to exit psql.
yourusernamehere - will be your desired postgresql username eg - johnnydoe