Skip to content

1 Getting Started

Lazaro Herrera edited this page May 28, 2017 · 16 revisions

This is the starting page for the wiki, and will deal with setup. Each page will begin with a short blurb about the goal of the page and the "target audience". This specific page will deal with the setup to allow you to download, execute and begin learning from this Project.

This page has been written at the "technical manager" level, with the assumptions that they

  1. "know what Github is"
  2. "know what code is"

The assumption is also that they do not have

  1. "a copy of Github Desktop"
  2. "an updated version of ruby"
  3. "know how to open their local Terminal in their MacBook and install / execute command-line software"
  4. "an understanding of basic Linux functions / how to navigate folders"

If the previous does not sound like you, maybe you should advance to the next page labeled "Installing the Tools"

Care will be taken to provide "plain English" documentation, but without using excessive "nerd English".

Installing Github Desktop

This is the link to Github Desktop.

The installation process is fairly straight forward but I will be documenting it below.

  1. Click Download Click Download

  2. Wait For the Download to Complete Wait For the Download to Complete

  3. Open the File Open the File

  4. Click the Search Icon (the little magnifier)

Click the Search Icon

  1. Type Applications Type Applications

  2. Drag the Application to the Folder You may also drag Github Desktop to the icon bar at the bottom of your Mac's screen to keep it there for easier access. Drag the Application to the Folder

  3. Double Click to Open Double Click to Open

  4. Click 'Sign into Github.com' Click 'Sign into Github.com'

  5. Click 'Sign in Using your Browser' Click 'Sign in Using your Browser'

  6. Click 'Authorize Desktop' Click 'Authorize Desktop'

  7. Mission Accomplished. Mission Accomplished.

Downloading the Repository

  1. Head to the project main page and click "clone or download" Click 'clone or download'

  2. Click 'Open in Desktop' Open in Desktop

  3. Click 'Open Github Desktop' Open Github Desktop

  4. Click 'Clone' Click Clone

  5. Mission Accomplished Mission Accomplished

Updating your Ruby and installing Homebrew

Most modern MacBooks contains a version of Ruby (normally 2.0.0). This version of ruby is ancient but we can upgrade it in order to run modern Ruby on Rails software. In this next section we will perform the following tasks

  1. Install a modern version of ruby
  2. Install Bundler

Before we do, let's have a bit of training to make the following sections easier. We will be "opening a terminal" or "opening a terminal session". Most of the management tasks a developer performs within Rails (creating new pages, doing database work) occur within a "terminal session".

Opening a terminal session.

  1. Click the Search Icon (the little magnifier)

Click the Search Icon

  1. Type "terminal" and press Enter Type terminal and press Enter

  2. Mission Accomplished. You may also drag the Terminal entry in the search results to the icon bar at the bottom of your Mac's screen to keep it there for easier access. Mission Accomplished

When running commands in the terminal, you need to press "Enter" or "Return" after you type the command.

Install a modern version of ruby

Installing a new version of ruby is easy but being able to install multiple versions for testing different projects is even better. We will be doing this with RVM (Ruby Version Manager).

  1. Open a terminal session Open a terminal session

  2. Execute the command - I have dragged it below for easier access.

    \curl -sSL https://get.rvm.io | bash -s stable

Install RVM

  1. Install a version of Ruby - At the time of writing, 2.4.0 was a decent version (get coffee, this takes forever)

    rvm install 2.4.0

![Install Ruby](Imgur

You can have RVM use it by default by running rvm default 2.4.0 followed by rvm use 2.4.0

Install Homebrew

Homebrew is not necessarily required to run this project, but it works great when you need a tool or something else for doing Rails development. Anything sexy from Linux that is missing on your MacBook can be installed using Homebrew. It is recommended for installation but not required.

  1. Open a terminal session Open a terminal session

  2. Execute the command - I have dragged it below for easier access.

    /usr/bin/ruby -e "$(curl -fsSL https://github.com/raw/Homebrew/install/master/install)"

Install Homebrew

Install Bundler

Bundler is one of the most used Ruby gem managers. It is used to ensure everything you need to run a project is installed quickly and effectively.

  1. Open a terminal session Open a terminal session

  2. Execute the command - I have dragged it below for easier access.

    gem install bundler

Install Bundler

Basic terminal knowledge

There are mountains and mountains of information relating to the terminal. My main objective is to get you to be comfortable moving around, get you to the Rails folder and install all of your requirements using bundler.

Moving around folders

By default, the terminal will place you at the "home" folder. This is your user folder and should have the same name as your username when logging into your computer.

Default

You can see what folders are available by typing ls which stands for "list directory contents"

ls_command

You can go into a folder by typing cd followed by the folder's name. For example, I will move into the activescratcher folder and see what's there using ls.

Quick Tip: If you use the "Tab" key halfway through typing the folder's name, the terminal can give you suggestions or autofill the rest of a long folder name. This saves you typing and reduces the risk of RSI.

cd_then_ls

You can go back up one folder by typing cd .. and confirm you are back by typing ls again.

back_to_home

Getting to the Rails folder

By default, newer versions of Github Desktop will download your projects in your home folder under a folder called "Github" under "Documents". Older versions of Github Desktop used to place your projects right at the home folder, just run an ls command and check visually for the folder. ls_command

You can use the cd Documents/Github/darnbrokenrails command to get you to the folder. cd_command_to_project

Using bundler to install all of your dependencies.

As you saw above, bundler is used to get all of the requirements for an application. You can install the dependencies by running the terminal command bundle install inside your project folder. running bundle install

Depending on how many dependencies there are, this may take a while.