Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Nola On Rails - #2 Shell && gem && Setup

Nola On Rails - #2 Shell && gem && Setup

A foray into the Terminal, shells, gems, and the installation process

Kurtis Rainbolt-Greene

March 01, 2012
Tweet

More Decks by Kurtis Rainbolt-Greene

Other Decks in Programming

Transcript

  1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. Installing && Setup: RVM • Open your browser to: http:

    //beginrescueend.com/ • Go to your Terminal • Follow the instructions
  8. 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`
  9. 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
  10. Install && Setup: Misc • In your terminal, use brew

    to install the following: ◦ MongoDB ◦ tree ◦ ack ◦ node
  11. 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
  12. 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