Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Homebrew + RVM > Awesome

The MBP is my development machine, so I needed all of my tools installed with the ability to update them with ease. In the past, I used MacPorts to take care of my MySQL, Memcached, and Ruby installions and it worked just fine. This time around however, I wanted something new and fun. Homebrew.

Homebrew is a new package manager for OS X. Unlike Fink or MacPorts, Homebrew integrates with the core operating system, reducing the number of extra libraries to install etc. Another neat feature is the ability to write software package recipes in Ruby, awesome.

Here are some raw installation instructions (clean system). I like to keep everything under user ownership to make life more enjoyable, say no to sudo.

You will need the latest version of xcode, you can get it here. After the installation is complete, you may continue.

sudo mkdir /usr/local
sudo chown -R $USER /usr/local
curl -Lsf \ | \
tar xvz -C /usr/local --strip 1
brew install git
brew update
brew install wget
brew install mysql
brew install memcached
brew install postgres
brew install redis
brew install mongodb
brew list

My homebrew experience has been a happy one, I don’t see myself using MacPorts or Fink again.

Homebrew documentation can be found here.

RVM (Ruby Version Manager) takes care of managing my multiple Ruby and Gem versions. Leaving the OS X default installation of ruby alone, RVM installs to a users home directory, changing the required system variables. Just how Homebrew is under user ownership, RVM is quite happy running this way as well and so am I.

To install RVM, do the following.

mkdir -p ~/.rvm/src && cd ~/.rvm/src && rm -rf ./rvm && \
git clone --depth 1 && \
cd rvm && ./install

Add the following line to the end of your .profile or .bash_profile or .bashrc file.

if [[ -s $HOME/.rvm/scripts/rvm ]]; then
  source $HOME/.rvm/scripts/rvm;
Try out RVM.
rvm install 1.8.7
rvm install 1.9.2
rvm --default 1.9.2
ruby -v
which ruby
gem install rails

Pretty neat eh? (I’m Canadian, it’s ok) RVM documentation can be found here.


This comment has been minimized.

Copy link

@toklok toklok commented Apr 14, 2016

Hey, thanks for writing this.


This comment has been minimized.

Copy link

@SurenderLohia SurenderLohia commented Aug 3, 2016



This comment has been minimized.

Copy link

@ghost ghost commented Oct 25, 2016

I believe you have to source the file before you can use rvm to install a Ruby version.


This comment has been minimized.

Copy link

@matthewhartman matthewhartman commented Feb 13, 2018

Thanks for sharing.

One small tweak:

mkdir -p ~/.rvm/src && cd ~/.rvm/src && rm -rf ./rvm && \
git clone --depth 1 git:// && \
cd rvm && ./install



This comment has been minimized.

Copy link

@jhmarina jhmarina commented Oct 31, 2019

Thanks for sharing this, it was pretty useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment