Skip to content

Instantly share code, notes, and snippets.

@bertomartin
Created October 17, 2013 17:47
Show Gist options
  • Save bertomartin/7029227 to your computer and use it in GitHub Desktop.
Save bertomartin/7029227 to your computer and use it in GitHub Desktop.

Ruby install for OSX

homebrew + rbenv + ruby-build

Installation of homebrew.

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

Installation of required packages.

brew install openssl
brew install readline
brew install libyaml
brew install autoconf
brew list -1 | egrep "openssl|readline|libyaml|autoconf"

Installation of rbenv and ruby-build.

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
mkdir -p ~/.rbenv/plugins
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

Edit .bashrc.

# ~/.bashrc
# Add the following.

if [ -d $HOME/.rbenv ]; then
  export PATH=$PATH:$HOME/.rbenv/bin
  eval "$(rbenv init -)"
fi

Installation of ruby by ruby-build.

source ~/.bashrc
rbenv install 2.0.0-p195
rbenv global 2.0.0-p195
ruby -v

Installation of gem frequently used.

gem i bundler
gem i pry pry-doc
gem i rspec
gem update rake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment