By: Christopher Waldeck
Ruby on Rails (or simply "Rails"), an immensely popular web development framework, is probably the easiest way to get started in web app development. With just a few lines of code required to create your first page, it certainly is the most immediately gratifying.
However, it is/was not engineered for an easy install on Windows.
To put it in perspective, it's so difficult to get right that the one-step install solution doesn't work. Do not - I repeat - do not use RailsInstaller. Sure, it will get the core programs on your system, but you won't be able to access gems because RubyGems (Ruby's package/library management system). This limits functionality in Ruby the same way removing bullets would limit a rifle's functionality.
Not to worry, though. We've got your back with something more helpful than suggesting you create an Ubuntu partition. Yeah, forget that. And you can go right to developer hell if you're the kind of person who would write that on a forum.
Step One: System Setup
Ruby and Rails (*nix software installs in general, really) require a little more discipline than most Windows folks are used to. Before we even start Googling and downloading, we need to set up a file where we'll keep all our Ruby stuff. I keep mine in my C: drive, and I suggest you keep it simple (and without spaces!) as well, as it will save you some cmd writing time in the future:
Step Two: Better Safe Than Sorry With NodeJs
Step Three: Picking Up The Installers
Go download RubyInstaller:
You need to grab the .exe file for the version of Ruby that matches with your system setup, and, though it isn't obvious, you need the Development Kit that corresponds with your Ruby selection:
In my case, I chose the second from the top on the left (Ruby 2.3.3) and the bottom option from the right.
Step Four: Install All The Things
With the installers locked and loaded, we're ready to get started with the actual Ruby install. Let's start with Ruby itself:
Be sure to change the installation folder, check the boxes to install Tcl/Tk support and adding Ruby to the system PATH. Ruby is extremely sensitive to your PATH configuration, and it's way better to get this done automatically now than to fumble with your environmental variables manually later. Click Finish on the next screen and you're good to go with Ruby.
Moving on to the Dev Kit now, first, make a folder in your RubyDependency file to house the zipped file you get from RubyInstaller:
Now, open the installer and extract the files there. It may take a minute or two.
It's a little unceremonious and a definite departure from Windows style to not tell you it's finished, but once the extract is done, your shiny new dev kit is on your system.
Step Five: Associate installations & Install Your First Gem
Now, we need to associate our Dev Kit with Ruby. To do this, we have to open up a command prompt, cd to our DevKit folder, initialize, and install the kit with the code below:
Now you're ready to install your first gem! Let's get you started with tiny_tds, a utility you'll definitely need if you're planning on connecting your Ruby on Rails applications to SQL Server databases.
Step Six: Install Rails
Finally, let's install Rails, which is done in exactly the same way as the gem above, but outputs a ton of "Parsing..." "Installed..." fanfair along the way:
That's it! In six steps, we have a fully-functioning install of Ruby and Rails that allows us to utilize gems exactly as Yukihiro Matsumoto intended!
Copyright © 2018