Skip to content

Instantly share code, notes, and snippets.

@matsuda
Last active December 14, 2019 03:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsuda/5329935 to your computer and use it in GitHub Desktop.
Save matsuda/5329935 to your computer and use it in GitHub Desktop.
install Ruby 2.0 with Homebrew
$ brew install openssl
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1e --openssldir=/usr/local/etc/openssl zlib-dynamic shared darwin64-x86_64-cc
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.1e/share/man MANSUFFIX=ssl
==> Caveats
To install updated CA certs from Mozilla.org:
brew install curl-ca-bundle
This formula is keg-only: so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
The OpenSSL provided by OS X is too old for some software.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
==> Summary
🍺 /usr/local/Cellar/openssl/1.0.1e: 429 files, 15M, built in 3.5 minutes
$ RUBY_CONFIGURE_OPTS="--enable-shared --with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 2.0.0-p0
Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...
Installed ruby-2.0.0-p0 to /Users/matsuda/.rbenv/versions/2.0.0-p0
$ brew upgrade rbenv
==> Upgrading 1 outdated package, with result:
rbenv 0.4.0
==> Upgrading rbenv
==> Downloading https://github.com/sstephenson/rbenv/archive/v0.4.0.tar.gz
######################################################################## 100.0%
==> Caveats
To use Homebrew's directories rather than ~/.rbenv add to your profile:
export RBENV_ROOT=/usr/local/var/rbenv
To enable shims and autocompletion add to your profile:
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
==> Summary
🍺 /usr/local/Cellar/rbenv/0.4.0: 31 files, 152K, built in 2 seconds
$ brew upgrade ruby-build
==> Upgrading 1 outdated package, with result:
ruby-build 20130408
==> Upgrading ruby-build
==> Installing ruby-build dependency: autoconf
==> Downloading http://ftpmirror.gnu.org/autoconf/autoconf-2.69.tar.gz
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/autoconf/2.69
==> make install
==> Caveats
This formula is keg-only: so it was not symlinked into /usr/local.
Xcode (up to and including 4.2) provides (a rather old) Autoconf.
==> Summary
🍺 /usr/local/Cellar/autoconf/2.69: 69 files, 2.0M, built in 6 seconds
==> Installing ruby-build dependency: pkg-config
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/pkg-config-0.28.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring pkg-config-0.28.mountain_lion.bottle.tar.gz
🍺 /usr/local/Cellar/pkg-config/0.28: 10 files, 636K
==> Installing ruby-build
==> Downloading https://github.com/sstephenson/ruby-build/archive/v20130408.tar.gz
######################################################################## 100.0%
==> ./install.sh
🍺 /usr/local/Cellar/ruby-build/20130408: 75 files, 332K, built in 2 seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment