Installing Ruby on Windows: Part I
This tutorial teaches you how to setup a Ruby development environment on any current version of Windows. Here you’ll learn to install Ruby, Ruby on Rails, Bundler, Git, MySQL, and SQLite3. In Part II of this tutorial, you will learn how to create a simple rails app to test the development environment you’ve setup.
Go to rubyinstaller.org and click on the ‘Downloads’ button. Download the Ruby 2.1.X installer you prefer, as recommended.
Also, download the version of DevKit designed for use with the version of Ruby you downloaded in step #1. So, if you downloaded the 32-bit version of Ruby, you’ll also need to download the 32-bit version of DevKit.
Once those downloads are done, go to your Downloads folder and double-click Ruby installer. A startup menu will appear. Choose your preferred language from the pop-up menu and accept the license after reading it thoroughly.
On the next section of the menu, be sure to click the option to add Ruby executables to your PATH, then click install. Once that’s done, click ‘Finish’ to exit the menu.
Go back to your Downloads folder and double-click on the DevKit file. A box will appear where you can choose the destination to which you’ll extract the files.
To the right of the ‘Extract to’ field, you’ll see a small button with three dots on it. Click it, then navigate to the Ruby installation directory. It should be in Ruby200. Add a “\devkit” to the end of that directory, then press extract.
Once the DevKit has extracted, it’s time to install it. Go to your desktop and enter ‘cmd’ into the search box of your Startup Menu, opening a command prompt.
Go to your Ruby installer directory by typing the following into the command prompt:
List all the files in the directory:
Now it’s time to install. First enter:
ruby dk.rb init
ruby dk.rb install
Now, exit the command prompt:
The next thing to install is Node.js, so go to nodejs.org and click Install to download. Once that’s done downloading, go to your Downloads folder and double-click ‘node’ to set it up. A setup menu will appear.
Read the terms agreement thoroughly, then click to accept it. Click ‘Next’ to install the files to the proper directory, and make sure that ‘Add to PATH’ is selected on the next screen.
Click install, click ‘Yes’ to allow it to make changes to your computer, then click Finish to exit the setup menu.
To complete your development environment, you’ll also need to download Git. Go to git-scm.com to the ‘Downloads’ section, then download the latest version for Windows.
Go to your Downloads folder and double-click on Git, then click ‘Yes’ to allow it to make changes to your computer.
Read the licensing agreement thoroughly, then click to accept it. Click ‘Next’ to install the files to the proper directory.
On the ‘Adjusting your PATH environment’ portion of the setup menu, choose to ‘Run Git and included Unix tools from the Windows Command Prompt’. On the next portion, make sure ‘Checkout Windows-style, commit Unix-style line endings’ is selected. Then click ‘Next’ to complete the download.
Once that’s done, go back to the Command Prompt via the search box on your desktop’s Startup Menu. Check to make sure you have Ruby installed:
This should display the version of Ruby you’ve just installed.
Next, you’ll need to install your gems, which you’ll need for working with rayons:
gem install bundler
Then, we’ll also need SQLite:
gem install sqlite3
After that, you may see several warnings from ASCII to UTF. Don’t worry about them. Install Rails:
gem install rails
And you’re done! Your Ruby development is ready to go. To learn how to create a simple app to test this environment, check out Part II of this tutorial.