A short guide to Homebrew

What is Homebrew

Homebrew is a package management system for Mac OS X.

How to install Homebrew

Step 1) Homebrew has a dependency on Xcode and Xcode command line tools. So first install latest Xcode and command line tools by going Xcode -> Preference, Choose “Downloads” tab and click on “install the Command Line Tools”

Step 2) Run this command in Terminal to install Homebrew –

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Now let’s go over a few common tasks you will have with Homebrew.

brew doctor

If you are doing any system update like OS X update or Xcode update you can check Homebrew’s health using this command. Homebrew will tell you if there is any issue with it or generally how to fix that issue.

brew update

This will update your Homebrew formula list. Please note that this will not update all your installed package it will just update the version and availability of packages you could install. You should run this often to keep your formula list updated or whenever you install/upgrade something new.

brew upgrade

This will update your installed packages.

brew install [package name here]

This will install new packages for you i.e.

brew install mysql

brew list

This will list all the packages that are currently installed on your system.

brew info [package name here]

This will show you information about a installed package.

brew uninstall [package name here]

The will remove package you previously installed.

So that’s is pretty much everything about Homebrew.

How to install Ruby 2.0.0 on Ubuntu 12.04 LTS

Follow below steps –

apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
tar -xvzf ruby-2.0.0-p0.tar.gz
cd ruby-2.0.0-p0/
./configure --prefix=/usr/local
make install