RVM => ruby-install & chruby

RVM is great, but I feel is not as easy as it should be, I want something really simple for my development environment a I believe ruby-install and chruby are the perfect way for me to manage my rubies.

First of all I need to remove RVM from my system:

$ rvm implode
$ sudo rm -rf ~/.rvm


To install ruby-install, I’m following the readme instructions for OSX and brew:

$ brew install ruby-install

Once that is finished I want to know what rubies I can install:

$ ruby-install

Since I want the latest stable version I run:

$ ruby-install ruby

Boom! I’m having troubles with openssl:

ossl_ssl.c:95:5: error: use of undeclared identifier ‘TLSv1_2_method
ossl_ssl.c:2266:23: error: invalid application of 'sizeof' to an incomplete type 'const struct (anonymous struct at ossl_ssl.c:85:14) []'
ary = rb_ary_new2(numberof(ossl_ssl_method_tab));

I think it has to do with my openssl version:

$ openssl version
OpenSSL 0.9.8zg 11 Jun 2015

So I installed openssl with brew and forced the links:

$ brew install openssl
$ brew link --overwrite openssl --force

Tried again:

$ ruby-install ruby

Success!! Ruby 2.3.1 was installed in:



To install chruby I run:

$ brew install chruby

To enable auto-switching of Rubies specified by .ruby-version files,
I added the following to my ~/.zshrc:

source /usr/local/share/chruby/chruby.sh
source /usr/local/share/chruby/auto.sh

Since I want to user Ruby 2.3.1 as my default ruby I created a .ruby-version file in my home directory:

$ echo "ruby-2.3.1" > ~/.ruby-version

Now, I restart my iTerm and run:

$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

One thing that I’m missing is a way to manage gems (I had that with RVM’s gemsets). Browsing the web around I found out that bundler provides a way to download and install gems to the project folder by running:

$ bundle install --path=vendor

which will create a folder called vendor in the current directory and install gems to it.

The only caveat is that I need to prefix any command that I run with bundle exec, for example:

$ bundle exec rake test

That’s it!

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.