Skip to content

Instantly share code, notes, and snippets.

@floehopper

floehopper/Vagrantfile

Last active Aug 9, 2019
Embed
What would you like to do?
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