Other Pages

Expand All

windows_railsinstaller.step

step "Choose your instructions" do
    message "Make your choice based on the workshop you will be attending tomorrow."

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


step "Run RailsInstaller" do
  message "RailsInstaller includes Rails, Ruby, Git and SQLite."
  message "Go to <http://railsinstaller.org/>, scroll to the 'Downloads' section, and download the RailsInstaller for Windows/Ruby #{version_string(:windows_ruby_short)}."
  message "Click on the downloaded file to run the install wizard.  Click Next at each step to accept the defaults."
  message "Be sure to check the boxes for *Install git (recommended)* and  *Add executables for Ruby, DevKit Git (if checked above) to the PATH*"

  img src: "img/WinRailsInstaller.jpg", alt: "Screenshot showing location of checkboxes for ensuring that Git is installed"

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

step "Configure your git and ssh environment" do

  important "At the end of the installer there will be a checkbox asking 'Configure git and ssh when installation has completed'. **Leave this box checked.** It will open a terminal window that you need to **type into**."

  message "When it asks *Please enter your name, for example mine is: Wayne E. Seguin*"
  message "Type *your actual full name* into the console and press **[enter]**"

  message "When it asks *Please enter your email address, for example mine is: wayneeseguin@gmail.com*"
  message "Type *your actual email address* into the console and press **[enter]**"

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

  tip do
    message "After this step you will have some **git config settings** and you will also have an **ssh key**."
  end

  message "Here is a summary of your settings after this process:"

  img src: 'img/railsbridge_windowsScreenshot-commandprompt_ror.png', alt: "Screenshot showing correct git, ruby, rails and ssh settings"

  message "Close the command prompt window."
end

step "Update Git" do

  message "The version of Git that comes with RailsInstaller is old, so we will be updating that next."

  message "Go to <http://git-scm.com> and download the installer. You want version 1.9.5 or newer."

  message "Run the installer, and it will ask you where you want to install it. Change it FROM C:\\Program Files\\Git  TO, C:\\RailsInstaller\\Git like the picture below."

  img src: 'img/directory.png', alt: "Screenshot showing the step of installation where the location to install git is set"

  message "It will warn you that the directory already exists. Click yes to install to that folder anyway."

  message "Keep going using the default selections and you'll have the latest version of Git installed!"

end

step "Open a Terminal" do
  message "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."

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

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

  message "To open the special Terminal, search for **Command Prompt with Ruby and Rails**."

  div do
    option_half "Windows 7" do
      img src: 'img/railsbridge_windows_findingCommandPrompt_win7.png', alt: "Screenshot showing search for command prompt"
    end

    option_half "Windows 8" do
      img src: 'img/railsbridge_windows_findingCommandPrompt_win8.png', alt: "Screenshot showing search for command prompt"
    end
  end

  message "You should do all your Rails work in this RailsInstaller DOS window."

  tip "Pin It to Win It" do
    message 'Pinning the Command Prompt to the taskbar is a handy shortcut.'

    img src: 'img/railsbridge_windowsScreenshot-commandprompt-pinnedtotaskbar.png', alt: 'Pin the Command Prompt to the Task Bar'
  end
end

a name: 'install-node'
step "Install Node.js" do

  message "Go to <http://nodejs.org> and download the installer. Pick the one that is \"recommended for most users.\""

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

  message "**Reboot your computer.**"

  message "Once your computer is back up, load **Command Prompt with Ruby and Rails** and..."

  console "node -v"
  fuzzy_result "v4{FUZZY}.x.x{/FUZZY}"
end

step "Update Rails" do
  message "Currently, RailsInstaller installs Rails 5.0.x, but we want the latest. Upgrading Rails is pretty easy:"

  console "gem install rails --no-document"

  message "...and you're done. New Rails! Woo."
end

step "Sanity Check" do

  console "ruby -v"
  fuzzy_result "ruby #{version_string(:windows_ruby_short)}{FUZZY}.4{/FUZZY}"

  console "rails -v"
  fuzzy_result "Rails 5.0{FUZZY}.x{/FUZZY}"

  console "git --version"
  fuzzy_result "git version 2{FUZZY}.9.2.windows.1{/FUZZY}"
end

step "Configure the Windows Terminal" do
  message "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."

  link "configure_the_windows_terminal"

  tip "Clearing the Terminal" do
    message "If you ever want to clear the terminal of all its cluttered output"
    console "cls"
  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 "create_a_heroku_account"