Skip to content

Instantly share code, notes, and snippets.

@ismarsantos
Forked from ipoerner/rbenv-deploy.sh
Created August 22, 2021 23:57
Show Gist options
  • Save ismarsantos/f7fea0419466e282dbf5e6a1c99344a5 to your computer and use it in GitHub Desktop.
Save ismarsantos/f7fea0419466e282dbf5e6a1c99344a5 to your computer and use it in GitHub Desktop.
Shell script to deploy rbenv w/ ruby-build plugin
#!/bin/sh
set -e # Exit script immediately on first error.
set -x # Print commands and their arguments as they are executed.
# Update Debian package index.
sudo apt-get update -y
# Install required Debian packages.
sudo apt-get install -y build-essential git-core wget zlib1g-dbg libssl-dev libreadline-dev libopenssl-ruby
# Get and install rbenv from GitHub
rm -rf ~/.rbenv
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
# Get and install ruby-build from GitHub
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment