Other Pages

Expand All

Windows Vagrant

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.

Installing Ruby and Rails on Windows is easy thanks to the RailsBridge Virtual Machine.

This setup will give you Ruby, Rails, Git and the Bash shell. Let's get started.

Make sure you have performed the pre-workshop steps.

Step 1: Launch Git

Launch Github for Windows. It will install a few dependencies. Once this is done, you may close it again.

Launch the Git Shell. You can find a shortcut on your Desktop (grey circle with a cat), or locate Git Shell in All Programs under GitHub. A new (mostly black) window will open.

Step 2: Set up your Vagrant box

If the file railsbridgevm-2016-09.box file you downloaded before the workshop isn't on your desktop, move it there.

Then type the following commands. Press ENTER after each command and wait for the operation to finish before typing the next one.

Type this in the terminal:
mkdir ~/Desktop/railsbridge
cd ~/Desktop/railsbridge
vagrant box add --name railsbridgemontreal railsbridgevm-2016-09.box
vagrant init railsbridgemontreal
vagrant up
vagrant ssh

If the process seems to hang after vagrant up, try hitting the ENTER key to get it going.

After typing the last command, here is what you should see (approximately):

Type this in the terminal:
C:\Users\DiligentStudent\Desktop\railsbridge> vagrant init railsbridgemontreal

A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
C:\Users\DiligentStudent\Desktop\railsbridge> vagrant up

Bringing machine 'default' up with 'virtualbox' provider...

Type this in the terminal:
   ...many lines left out...
[default] -- /vagrant
C:\Users\Diligent Student\Desktop\railsbridge> vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)
   ...many lines left out...
Changing directory to the shared ~/workspace folder for your convenience.
[RailsBridge VM] ~/workspace$

Step 3: Open another Vagrant shell

Leave this terminal window open on your computer. To open an extra Terminal (console) into the virtual machine, open another Git Shell window, then type:

Type this in the terminal:
cd ~/Desktop/railsbridge
vagrant ssh
[RailsBridge VM] ~/workspace$

Continue with the next step of the Installfest. @TODO LINKY BACK

Step 4: Usage Tips

Turning the virtual machine off and on

When you're done for the day, logout and stop your machine:

Type this in the terminal:
logout
vagrant halt

And close the Git Shell window.

When you want to use the virtual machine (tomorrow morning, for instance), start your machine. Launch Git Shell, then:

Type this in the terminal:
cd ~/Desktop/railsbridge
vagrant up
vagrant ssh

Clearing the Terminal

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

Type this in the terminal:
clear

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 5: 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.

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

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

Next Step: