Skip to content

Instantly share code, notes, and snippets.

@tony4d
Last active August 29, 2015 14:02
Show Gist options
  • Save tony4d/fbe7e362af1df20ac750 to your computer and use it in GitHub Desktop.
Save tony4d/fbe7e362af1df20ac750 to your computer and use it in GitHub Desktop.
Compile ruby from source for rbenv on OS X
# Assumptions:
# - You are using rbenv, installed in ~/.rbenv
# - You are using homebrew
# - You want to install ruby 2.1.2 (for example)
#
# Make sure you have openssl installed first
brew install openssl
# Before you begin, download ruby source from https://www.ruby-lang.org/en/downloads/
tar -zxvf ruby-2.1.2.tar.gz
cd ruby-2.1.2
./configure --prefix=`echo ~`/.rbenv/versions/2.1.2 --with-openssl-dir=`brew --prefix openssl`
make
make install
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment