Skip to content

Instantly share code, notes, and snippets.

@JustinAiken
Forked from MicahElliott/rbenv-howto.md
Created October 29, 2012 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JustinAiken/3976862 to your computer and use it in GitHub Desktop.
Save JustinAiken/3976862 to your computer and use it in GitHub Desktop.
Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

Setting up and installing rbenv, ruby-build, rubies, rbenv-gemset, and bundler

This guide enables you to install (ruby-build) and use (rbenv) multiple versions of ruby, isolate project gems (gemsets and/or bundler), and automatically use appropriate combinations of rubies and gems.

TL;DR Demo

# Not sure how much of this we need
aptitude install git zsh libssl-dev zlib1g-dev libreadline-dev libyaml-dev

# Install rbenv for managing enabling of multiple rubies.
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
exec $SHELL

# Install the ruby-build plugin for easy building of rubies.
mkdir -p ~/.rbenv/plugins
cd !$
git clone git://github.com/sstephenson/ruby-build.git
cd where/ever

# Install a ruby
rbenv install 1.9.3
rbenv rehash

# Enable a newly installed ruby, persistently, globally.
rbenv global 1.9.3
rbenv rehash

# Install bundler, create a Gemfile, install to project.
gem install bundler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment