Last Updated: February 25, 2016
·
17.97K
· deioo

Install ruby 2.1.1 with brew and rbenv

Assuming you have homebrew and rbenv already installed, run the following:

brew update
brew upgrade ruby-build
rbenv install 2.1.1

This will update brew, upgrade ruby-build and install ruby 2.1.1 in 3 easy steps.

7 Responses
Add your response

If you run into this error:

The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

Try:

brew install openssl

RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr/local/Cellar/openssl/1.0.1e rbenv install 2.1.1

https://github.com/sstephenson/ruby-build/issues/377#issuecomment-21014365

over 1 year ago ·

or you can:

$ brew link readline openssl --force
$ rbenv install 2.1.2

that helps me... you can then unlink those if you wish

over 1 year ago ·

Awesome post man! Thanks!

over 1 year ago ·

For some reason "brew upgrade ruby-build" did not update rbenv list.
<br />The trick I found was to manually pull update:
<br />cd ~/.rbenv
<br />git pull
<br />cd plugins/ruby-build
<br />git pull

over 1 year ago ·

+1 for wihodges! Same problem for me

over 1 year ago ·

Updating still works fine for 2.1.3 too

over 1 year ago ·

Also works for ruby 2.1.4

over 1 year ago ·