Skip to content

Instantly share code, notes, and snippets.

@floehopper
Last active October 22, 2021 20:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save floehopper/3bfa23166e83c84c2922c2f7e1e2f2cb to your computer and use it in GitHub Desktop.
Save floehopper/3bfa23166e83c84c2922c2f7e1e2f2cb to your computer and use it in GitHub Desktop.
Ubuntu Xenial with Ruby installed via rbenv
PROVISION_SYSTEM = <<~EOS
set -e
apt-get update --yes
apt-get install --yes gcc
apt-get install --yes make
EOS
PROVISION_USER = <<~EOS
set -e
mkdir -p ~/.rbenv
cd ~/.rbenv
git init
git remote add -f -t master origin https://github.com/rbenv/rbenv.git
git checkout -b master origin/master
mkdir -p ~/.rbenv/plugins
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
rbenv install ruby-2.6.3
rbenv global ruby-2.6.3
EOS
Vagrant.configure('2') do |config|
config.vm.box = 'ubuntu/xenial64'
config.vm.box_version = '20170914.2.0'
config.vm.provision :shell, inline: PROVISION_SYSTEM
config.vm.provision :shell, privileged: false, inline: PROVISION_USER
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment