Other Pages

Expand All

windows_vagrant.step

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

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

message "Installing Ruby and Rails on Windows is easy thanks to the RailsBridge Virtual Machine."
message "This setup will give you Ruby, Rails, Git and the Bash shell. Let's get started."

message "Make sure you have performed the pre-workshop steps."


step "Launch Git" do

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

  message "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."

end

step "Set up your Vagrant box" do

  message "If the file [railsbridgevm-2016-09.box](http://downloads.railsbridge.org/railsbridgevm-2016-09.box) file you downloaded before the workshop isn't on your desktop, move it there."

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

  console <<-BASH
    mkdir ~/Desktop/railsbridge
    cd ~/Desktop/railsbridge
    vagrant box add --name railsbridgemontreal railsbridgevm-2016-09.box
    vagrant init railsbridgemontreal
    vagrant up
    vagrant ssh
  BASH

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

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

  console <<-BASH
    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
  BASH

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

  console <<-BASH
       ...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$
  BASH

end

step "Open another Vagrant shell" do
  message "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:"

  console <<-BASH
    cd ~/Desktop/railsbridge
    vagrant ssh
    [RailsBridge VM] ~/workspace$
  BASH

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

step "Usage Tips" do
  tip "Turning the virtual machine off and on" do

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

    console <<-BASH
      logout
      vagrant halt
    BASH

    message "And close the Git Shell window."

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

    console <<-BASH
      cd ~/Desktop/railsbridge
      vagrant up
      vagrant ssh
    BASH
  end

  tip "Clearing the Terminal" do
    message "If you ever want to clear the terminal of all its cluttered output"
    console "clear"
  end

  tip "Command History" do
    message "The terminal window stores a \"command history.\" To view and re-run previous commands, use the &lt;up arrow&gt; and &lt;down arrow&gt; 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."
  end

  tip "Copy and Paste" do

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

    message "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."
  end
end

step "Install a Text Editor" do
  insert "install_text_editor_windows"
end


next_step "configure_git"