Setting up a new Mac for Rails Development

January 04, 2011

I just got a new MacBook (whoo hoo!) because my old machine dies (boo hoo) and thought I'd write down the steps I'm taking to set it up. I imagine this is more for myself than anyone else but keep reading if you like.

  • Some Apps
    1. Google Chrome for browsing
    2. TextMate for editing
    3. Adium for IM

  • Homebrew for package management
    1. Open a terminal and type
      ruby -e "$(curl -fsSL https://gist.github.com/raw/323731/install_homebrew.rb)
      
    2. Download and Install XCode from Apple

  • git & github for development
    1. Install GIT
      brew install git
      
    2. create ssh keys and add to github following these instructions
    3. Configure git
      git config --global user.name "Alex Rothenberg"
      git config --global user.email "alex@alexrothenberg.com"
      git config --global color.ui true

  • RVM
    1. Install rvm
    2. add bundler to ~/.rvm/gemsets/global.gems and install it
      echo bundler >> ~/.rvm/gemsets/global.gems
      gem install bundler
    3. install Ruby 1.8.7 and make it default
      rvm install 1.8.7
      rvm --default 1.8.7

  • Databases
    1. MySQL
      brew install mysql
      
    2. Oracle (this is complicated but works if you follow the directions exactly TO THE LETTER without missing a single step!) http://blog.rayapps.com/2009/09/14/how-to-install-oracle-database-10g-on-mac-os-x-snow-leopard/. Then I did have to run these extra commands
      1. Add oracle env settings to my user
        #.bashrc
        ## ORACLE
        export ORACLE_HOME=/Users/oracle/oracle/product/10.2.0/db_1
        export DYLD_LIBRARY_PATH=$ORACLE_HOME/lib
        export ORACLE_SID=orcl
        PATH=$PATH:$ORACLE_HOME/bin

      2. Enable me to access the oracle files
        sudo dscl localhost -append /Local/Default/Groups/oinstall GroupMembership alex
        
      3. SQL Developer is an Oracle GUI

  • Test with a project
    git clone git://github.com/alexrothenberg/legacy_data.git
    cd legacy_data
    export MYSQL
    export ORACLE
    bundle install
    rake
    

  • Finally I'm following the trend and setting up a dotfiles project on github so I don't have to recreate them in the future.