OS X 106 (Snow Leopard)

Install the Xcode Tools

Advanced user note: Xcode is required on Snow Leopard. On some older versions of OS X, you could get away without it when installing Rails, as long as you weren't using MacPorts. Not so on Snow Leopard, unfortunately.

Special note for folks who upgraded to Snow Leopard: The SQLite gem does not compile with an older version of Xcode installed. If you upgraded your machine from an older version of OS X, and you have an older Xcode, you still need to reinstall it from your Snow Leopard DVD. The steps below should work fine to upgrade it.

Steps:
  • Insert your Snow Leopard install DVD. (What to do if you don't have an OS X install DVD)
  • Open "Optional Installs" folder.
  • Double-click Xcode.mkpg. It will bring up a window titled "Install Xcode."
  • Click "Continue" button at the Introduction screen.
  • Click "Continue" button at the License screen.
  • Click "Agree" button in the popup to agree to the license.
  • Click "Continue" button at the Destination Select screen.
  • Don't change the checkboxes. Click "Continue" button at the Installation Type screen.
  • Click "Install" button to start installing.
  • Enter your user password in the popup to REALLY start installing. It takes a while.
  • Click "Close" button once you get "The installation was successful" on the Summary screen.

Install Git, Ruby, Rails, and Gems

  • Create a folder called rubydownloads (all lower case, no punctuation or spaces) on the desktop.
  • Download the following files, and move them all into rubydownloads.
  • Open Terminal.app. It's in Applications -> Utilities. Add it to your dock; you'll be using it a lot. (To add it to the dock, click and hold the dock icon once Terminal is open. Select options -> keep in dock.)
  • Inside the Terminal window, type the following, with a return at the end of each line:
    cd Desktop
    curl -o bootstrap_snow_leopard.sh https://gist.github.com/574651.txt
    chmod u+x bootstrap_snow_leopard.sh
  • Now you've downloaded the installation script and set appropriate permissions on it. Now you can run it! Inside the Terminal window, type the following, with a return at the end of the line:
    ./bootstrap_snow_leopard.sh
  • You may need to enter your user password at some point during the installation. You'll see a prompt such as "Password:" in the Terminal window. It's safe to type your user password in there.
  • This will run for a while. Once you see "Done!" in the Terminal window, it's complete. # Note: this script installs rails 2.3.9, so afterwards run:
    sudo gem install rails --version 3.0 --no-rdoc --no-ri

Install SQLite Manager Firefox plugin

  • Firefox, if you don't already have it. You may need to upgrade - SQLite Manager requires Firefox 3.5 or greater.
  • Install the SQLite Manager plugin . If you have trouble installing, double-check that your Firefox version is at least 3.5.

Install KomodoEdit

We'll be using the KomodoEdit text editor during the workshop, though you are free to use a different editor if you prefer. It must be a plain-text editor, such as vi or Textmate. Microsoft Word and other word processing programs won't work. If in doubt, use KomodoEdit.

Installation steps:
  • Download the KomodoEdit installer .
  • Select "Open with DiskImageMounter" in the file save dialog. This should be the default.
  • It will open an installer with a KomodoEdit icon and a picture of your Applications folder. Drag KomodoEdit into your Applications folder.
  • Unmount the installer disk image by dragging it from your desktop to the trash.

Verify successful installation

In this step, we make sure the installation script actually installed everything correctly.

Steps to verify installation:

  • In a Terminal window, type the following, followed by return:
    which git
    It should say:
    /usr/local/bin/git
  • In a Terminal window, type the following, followed by return:
    which ruby
    It should say:
    /usr/local/bin/ruby
  • In a Terminal window, type the following, followed by return:
    which rails
    It should say:
    /usr/local/bin/rails
  • In a Terminal window, type the following, followed by return:
    gem list --local
    It should say: * LOCAL GEMS *

    actionmailer (2.3.9)
    actionpack (2.3.9)
    activerecord (2.3.9)
    activeresource (2.3.9)
    activesupport (2.3.9)
    builder (2.1.2)
    configuration (1.1.0)
    cucumber (0.6.2)
    cucumber-rails (0.2.4)
    diff-lcs (1.1.2)
    gherkin (1.0.30)
    heroku (1.8.0)
    json (1.2.0) or json_pure (1.4.3)
    launchy (0.3.5)
    nokogiri (1.4.1)
    polyglot (0.3.0) (optional)
    rack (1.1.0)
    rails (2.3.5)
    rake (0.8.7)
    rest-client (1.3.1)
    rspec (1.3.0)
    rspec-rails (1.3.2)
    sqlite3-ruby (1.2.5)
    term-ansicolor (1.0.4)
    treetop (1.4.3) (optional)
    webrat (0.7.0)

Finally, make sure you can do everything in the following sections of the install directions (from "Create a Test Application" onwards). Wherever it says "git bash", you can mentally substitute "Terminal" - git bash is the name for the Terminal-equivalent program on Windows. I know, strange name!

Congratulations!

You have everything you need to write a Ruby on Rails application.

Cleanup

You won't be using the test application in the workshop; we just created it to make sure everything was working. You should delete it now to reduce confusion during the workshop. Don't worry about losing information - you'll repeat all the steps tomorrow, but more slowly so you can better understand what's going on under the hood.

  • Drag the test_app folder (inside ruby_on_rails) to the trash. Leave ruby_on_rails on the desktop.
  • Delete the app from Heroku. Go to https://heroku.com/myapps and then click on your app name. Scroll to the bottom of the page and click Destroy App.