Ruby on Rails is a web development framework that was first introduced in 1999. Despite it’s “age”, it’s still a popular choice for developing web applications.
In this small tutorial, we’re going to go through the steps involved in setting up Rails6 on Windows10.
There are a few Rails installer type of projects available, but I’ve found that these mostly don’t work anymore despite coming up near the top of any search in google. If you’ve come across them already and they work for you, then fantastic!
I’m not throwing shade at any of these projects, by the way, merely trying to communicate to others who might be hunting around for the same information and coming across the same resources (and therefore experiencing the same frustration).
the current popular (but troublesome) Rails installers on Windows10
- RailsInstaller - the Windows download this project offers is for Ruby 2.3 which is quite outdated. As of this writing, I’m using Ruby 2.6.5. I recommend you skip this one.
- Install Rails - this is another fine effort, but still referencing the older Ruby download from
railsinstaller. I also recommend you skipping this one.
- Go Rails - this is a high quality Ruby on Rails installation guide, but its relying on the use of the Linux Subsystem for Windows10. I love Linux, don’t get me wrong, but if I want Linux, I’d just use it directly or via an image on the cloud. At any rate, if this one is working for you and your setup preferences, then please STICK with it.
using Chocolately to install Ruby on Rails on Windows10
Let’s get started. This one takes a few steps, but I’ve found that it’s been a highly repeatable process on my Windows10 installs.
- Head to chocolatey.org for a glance through the site
- You need to install Chocolatey through PowerShell (but it’s about the only time we need a PowerShell window).
Get-ExecutionPolicy. If it returns
Restricted, then run
Set-ExecutionPolicy Bypass -Scope Process.
- When that completes, paste the following snippet into the shell and hit
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
- Just to be sure your system
PATHis updated, close the PowerShell console window
install ruby via chocolatey
- You’ll have to install ruby with
- Open a command prompt window using
Run as Administrator
choco install rubyin the console
- Once the install finishes, close the command prompt window. We no longer need
Administratorlevel AND we want to make sure our system
PATHhas been updated
- By default, Chocolatey will install
- Open a command shell
- Navigate to the
binfolder - aka.
- When prompted, just hit
Enter(we want the defaults)
- The installation will take a little bit of time
- You’ll be prompted for any further actions, again just hit
- We’re finally there! We can install Rails6 now!
- Open a command shell (or re-use the one from the previous step)
gem install rails
There are several popular resource guides available for installing Ruby on Rails on Windows10, but they are either quite outdated, or may not be a good “fit” with your system setup.
To try and help others coming across the same batch of resources and hitting the same speed bumps, I put together this small guide to give you a hand. Hopefully it does the job for you without issue(s).