Other Pages

Expand All


These instructions should work for all versions of Windows from XP to Windows 8.

You may need to login as Administrator, or give the Administrator password when installing some programs, depending on your Windows version and user settings.

Step 1: Run RailsInstaller

RailsInstaller includes Rails, Ruby, Git, and SQLite.

Go to http://railsinstaller.org/, scroll to the 'Downloads' section, and download the RailsInstaller for Windows/Ruby 1.9.

Alternatively, ask a volunteer for a flash drive with the file on.

Click on the RailsInstaller file to run the install wizard. Click Next at each step to accept the defaults.

Be sure to check the boxes for Install git (recommended) and Add executables for Ruby, DevKit Git (if checked above) to the PATH

Rails will be installed in C:\RailsInstaller and the directory for your Rails projects will be C:\Sites

Step 2: Configure your git and ssh environment

At the end of the installer there will be a checkbox asking 'configure your git and ssh environment'. Leave this box checked. It will open a terminal window that you need to type into.

When it asks Please enter your name, for example mine is: Wayne E. Seguin

Type your full name into the console and press [enter]

When it asks Please enter your email address, for example mine is: wayneeseguin@gmail.com

Type your email address into the console and press [enter]

Use the same email address for heroku, git, github, and ssh.

After this step you will have some git config settings and you will also have an ssh key.

Step 3: Windows 8 Only - Install Node.js

Go to http://nodejs.org and download the installer

Click on the downloaded file to run the install wizard. Click Next at each step to accept the defaults.

Reboot your computer.

Once your computer is back up, load Command Prompt with Ruby and Rails (see below) and...

Type this in the terminal:
node -v
Approximate expected result:
The greyed-out text may differ and is not important.

Step 4: Update Rails

Currently, RailsInstaller installs Rails 3.2.x, but we want 4.x. Upgrading Rails is pretty easy:

Type this in the terminal:
gem install rails

...and you're done. New Rails! Woo.

Step 5: Sanity Check

Type this in the terminal:
ruby -v
Approximate expected result:
ruby 1.9.3p125
The greyed-out text may differ and is not important.
Type this in the terminal:
rails -v
Approximate expected result:
Rails 4.0.x
The greyed-out text may differ and is not important.

Step 6: Open a Terminal

Much of using Rails is typing commands and hitting [enter]. Your experience using Rails on Windows greatly depends on your making friends with the terminal window. Normally you will work in a terminal window and keep it open along with your browser.

The Terminal is also called the Command Prompt, Command Line, DOS Prompt, or DOS Window.

RailsInstaller made a special Terminal for you to use when you're working on Ruby, Rails, or Git.

To open the special Terminal, choose All Programs on the Start menu, then choose RailsInstaller and then Command Prompt with Ruby and Rails. You should do all your Rails work in this RailsInstaller DOS window.

Pin It to Win It

Here is a summary of your settings after this process:

Step 7: Configure the Windows Terminal

Take a moment to configure the Command Prompt with Ruby and Rails so that it is a good height and width and has a nice font. Hint -- click to open the link below, and when you finish those steps, hit the back button in your browser to resume this procedure.

Clearing the Terminal

If you ever want to clear the terminal of all its cluttered output

Type this in the terminal:

Command History

The terminal window stores a "command history." To view and re-run previous commands, use the <up arrow> and <down arrow> keys. You can also edit a previous command and run it -- this is handy for long commands, or fixing mistakes, or for cycles (series of commands) that you repeat.

Copy and Paste

It's usually better to type commands in yourself. It takes a little longer but you learn more.

But if you must... in these instructions, where it says: "Type this in the terminal:", you can usually copy the command from this page, and right click in the menu bar or terminal window, then click on "Paste", then hit the [enter] key.

Step 8: Install a Text Editor

You need a text editor to do Ruby. If you already have a preferred text editor, such as vi, emacs, jedit, etc., you can skip this step. It must be a plain text editor and not something with styling like Microsoft Word or WordPad.

Notepad is not a good programming editor, but it will work in a pinch.

When in doubt, use Sublime Text 2.

Sublime Text 2 is a good option, if you don't have one yet.

Download Sublime Text 2 here: http://www.sublimetext.com/2

Next Step:

Back to Choose Your Operating System

If you find something that could be improved, please make a pull request or drop us a note via GitHub Issues (no technical knowledge required).

Source: https://github.com/RailsBridge-CapeTown