Skip to content

Instantly share code, notes, and snippets.

@satanas
Last active September 28, 2018 19:31
Show Gist options
  • Save satanas/c3912b8d799e2a7a07cca11ddf38c76e to your computer and use it in GitHub Desktop.
Save satanas/c3912b8d799e2a7a07cca11ddf38c76e to your computer and use it in GitHub Desktop.
Install and set up ruby without rvm/rbenv

First, install ruby-build and chruby:

brew install chruby ruby-build

Then install your ruby version:

ruby-build 2.1.0 ~/.rubies/ruby-2.1.0

Note that chruby looks in ~/.rubies for a directory matching the name it finds in your .ruby-version file.

Once installed, add the following lines to your ~/.bashrc or ~/.zshrc file:

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

The second line is optional but it's recommended since it will change your ruby version automatically when you cd into a directory with a .ruby-version file.

After that, install bundler:

gem install bundler

Finally, add the following line to your ~/.bundle/config file:

BUNDLE_PATH: ".bundle"

If the file doesn't exist you need to create it and add three dashes in the first line, then add the directive. That will make bundler to install the dependencies into a .bundle directory inside your project's root folder (instead of globally).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment