Slide 1

Slide 1 text

Nola On Rails Session 2 Shell && gem && Setup

Slide 2

Slide 2 text

The Terminal && The Shell ● The terminal is a program that allows you access to the shell ● The shell is a IDAC (In-Act-Out Console) ● There are many shell programs, but primarily people use BASH and ZSH ● The terminal is our window to the shell ● The shell is our window to the operating system

Slide 3

Slide 3 text

Binaries ● Binaries are programs that do things from the command line ● Most Ruby binaries are written in Ruby ● Binaries (sometimes) take input ○ Some inputs are called "arguments" or "args" ○ Some inputs are called "flags" ● Binaries run some code ● Binaries (sometimes) return output ○ Most binaries return "exit codes" ○ Most binaries return some text output ○ Others can make files

Slide 4

Slide 4 text

Package Managers ● Package Managers are programs that install packages of software ● Software installed by PMs are usually called "libraries" ● Homebrew is the PM of choice for Rails developers

Slide 5

Slide 5 text

Libraries, gem, RubyGems ● Libraries are collections of code that fits a common concept (libsqlite3, libopenssl) ● Libraries in Ruby are called "gems" ● Gems can be downloaded and installed with the `gem install` command ● Gems are primarily hosted openly on http: //rubygems.org

Slide 6

Slide 6 text

Install && Setup: brew ● Open your browser to: https://github. com/mxcl/homebrew/wiki/installation ● Open your Terminal ● Follow the instructions ● Run: `brew install git` ● If you get a warning about XCode, go download it at the link

Slide 7

Slide 7 text

Install && Setup: zsh + oh-my-zsh ● Open your browser to: https://github. com/robbyrussell/oh-my-zsh#readme ● Open your Terminal ● Follow the instructions ● Add these plugins to the `.zshrc`: ○ git ○ gem ○ rvm ○ brew ○ bundler ○ history-substring-search ● Reopen the terminal

Slide 8

Slide 8 text

Installing && Setup: RVM ● Open your browser to: http: //beginrescueend.com/ ● Go to your Terminal ● Follow the instructions

Slide 9

Slide 9 text

Install && Setup: rubies ● Run `rvm list known` ● Run `rvm install --default ruby-1.9.3` ● Run `rvm install rbx-2.0.0pre` ● Check the version of ruby ● Setup an alias for mri with: `rvm alias create mri ruby-1.9.3` ● Setup an alias for rbx with: `rvm alias create rbx rbx-2.0.0pre ● Switch to Rubinius and check that version with: `rvm rbx` ● Switch back to mri with: `rvm mri`

Slide 10

Slide 10 text

Install && Setup: Bundler+Rails ● Bundler is a library that helps you handle all your gems ● While in mri use `gem install bundler --pre` ● While in mri use `gem install rails` ● While in rbx install bundler and rails ● Switch back to mri

Slide 11

Slide 11 text

Install && Setup: Misc ● In your terminal, use brew to install the following: ○ MongoDB ○ tree ○ ack ○ node

Slide 12

Slide 12 text

The file system ● The file system is a program that handles the organization of folders (or dirs) and files ● While in the terminal run: `l` ● These are a list of the files and folders in the current directory ● The file path is the path of folders that lead to your current "location" ● Changing directories is done with the `cd` command ● The ~ symbol is "home" directory

Slide 13

Slide 13 text

Setting up your first rails app ● Create a repository folder in your home directory ● Go into that directory ● Run the rails command without arguments to get the help ● Run: `rails new fantastory --skip-bundle -G - O -T` ● Run the tree command ● Open your editor ● Add the project directory

Slide 14

Slide 14 text

Resources ● The Command Line Crash Course