Skip to content

Instantly share code, notes, and snippets.

@ptantiku
Last active December 19, 2015 18:18
Show Gist options
  • Save ptantiku/5997526 to your computer and use it in GitHub Desktop.
Save ptantiku/5997526 to your computer and use it in GitHub Desktop.
Install RBENV
# Install development tools:
sudo apt-get update
sudo apt-get -y install build-essential git-core \
make libc6-dev libssl-dev libssl-dev \
libreadline6-dev zlib1g-dev libyaml-dev
# Install rbenv:
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
# Add rbenv to the path (for BASH):
echo 'if [ -d "$HOME/.rbenv" ] ; then' >> .bashrc
echo ' export PATH="$HOME/.rbenv/bin:$PATH"' >> .bashrc
echo ' export PATH="$HOME/.rbenv/shims:$PATH"' >> .bashrc
echo ' eval "$(rbenv init -)"' >> .bashrc
echo 'fi' >> .bashrc
source ~/.bashrc
# Add rbenv to the path (for ZSH)
echo 'export RBENV_ROOT="$HOME/.rbenv"' >> .zshrc
echo 'if [ -d "$RBENV_ROOT" ]; then' >> .zshrc
echo ' export PATH="$RBENV_ROOT/bin:$PATH"' >> .zshrc
echo ' export PATH="$RBENV_ROOT/shims:$PATH"' >> .zshrc
echo ' eval "$(rbenv init -)"' >> .zshrc
echo 'fi' >> .zshrc
# Install ruby-build:
mkdir -p ~/.rbenv/plugins
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
PREFIX=~/.rbenv ~/.rbenv/plugins/ruby-build/install.sh
# Install rbenv-bundler:
git clone -- git://github.com/carsomyr/rbenv-bundler.git ~/.rbenv/plugins/bundler
# Rehash:
rbenv rehash
# Install Ruby 1.9.3-p448:
rbenv install 1.9.3-p448
rbenv global 1.9.3-p448
# Rehash:
rbenv rehash
# Install Bundler
gem install bundler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment