Setting up Rails on a Clean Install of Mac OS X Lion


I realise that OSX does not have a registry to clog up but I have just reinstalled Lion on my Macbook Air; probably a hang up from Windows. This is a checklist for installing Homebrew >> Rails.

  1. Install XCode 4.1 (There are issues with the 4.2 compiler and certain rubies and gems)
  2. Install Homebrew
    1. https://github.com/mxcl/homebrew/wiki/installation
    2. /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
  3. Ensure Homebrew apps are in path before Mac apps
    1. export PATH=/usr/local/bin:$PATH or edit /etc/paths
  4. Install Git
    1. brew install git (thanks Brendan)
  5. Install SSH keys
    1. Generate or copy from ~/.ssh from a backup.
  6. Install RVM
    1. https://rvm.beginrescueend.com/rvm/install/
    2. bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
    3. Add [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session. to bash_profile
    4. Restart shell
    5. Run rvm | head -1
  7. Install latest Ruby and set as default
    1. rvm install 1.9.3 (make sure you are using Xcode 4.1)
    2. rvm --default use 1.9.3
  8. Install Rails
    1. gem install rails

I keep all my .config files in Dropbox and run a bash script to create aliases in my home folder.

 

, , , , , , , ,

  1. #1 by Brendan Kilfoil on November 15, 2011 - 20:56

    Nice write-up. Had problems with step 4 – resolved by using “brew install git” instead of “brew git install”. Thanks!

  2. #2 by John on November 16, 2011 - 15:30

    Oops. Thanks and fixed.

  3. #3 by El Gringo on December 1, 2011 - 23:29

    Seems that correct line is
    rvm use 1.9.3 –-default

    Thanks for your article

  4. #4 by John on December 2, 2011 - 10:51

    Arghhh. Thanks for spotting that. There are actually 2 hyphens there but it is being rendered as a single hyphen, however it prompted me to check https://rvm.beginrescueend.com/rubies/default/ and it seems rvm –default use 1.9.3 is the way to go. I’ll change it and enclose it in a code element or gist.

(will not be published)