Skip to content

Instantly share code, notes, and snippets.

@harmesy
Created February 27, 2016 04:58
Show Gist options
  • Save harmesy/f3dd02c3ea349c5893d9 to your computer and use it in GitHub Desktop.
Save harmesy/f3dd02c3ea349c5893d9 to your computer and use it in GitHub Desktop.
Rails Vagrantfile
update-locale LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8
echo 'gem: --no-document' > /home/vagrant/.gemrc
echo -e '--database=postgresql\n--skip-test-unit' > /home/vagrant/.railsrc
apt-get -y update
apt-get -y install git curl build-essential nodejs postgresql postgresql-contrib libpq-dev
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
\curl -sSL https://get.rvm.io | bash -s stable --ruby
source /usr/local/rvm/scripts/rvm
gem install rails --no-document
sudo -u postgres createuser --superuser vagrant
sudo -u postgres createdb -O vagrant app_development
sudo -u postgres createdb -O vagrant app_test
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "forwarded_port", guest: 3000, host: 3000
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.provision "shell", path: 'bootstrap.sh'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment