Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config| = "ubuntu/trusty64" "forwarded_port", guest: 3000, host: 3000
# runs as root
config.vm.provision "shell", inline: <<-SHELL
apt-get update
git --version || apt-get install -y git
rails --version || apt-get install -y ruby-railties-4.0
nodejs --version || apt-get install -y nodejs
# runs as non-root user "vagrant"
config.vm.provision "shell", privileged: false, inline: <<-SCRIPT
gpg --keyserver hkp:// --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
curl -sSL | bash -s stable --rails
source /home/vagrant/.rvm/scripts/rvm
rbenv install 2.0.0-p353
rbenv global 2.0.0-p353
yes | gem update
gem install rdoc
gem install rails pg
if [ ! -d "/vagrant/toy_app" ]; then
(cd /vagrant && rails new toy_app)
(cd /vagrant/toy_app && bundle install)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment