Skip to content

Instantly share code, notes, and snippets.

@chrisvel
Forked from hopsor/Vagrantfile
Created November 18, 2020 10:28
Show Gist options
  • Select an option

  • Save chrisvel/30aefddb5d39310eaf17415b0d06d5db to your computer and use it in GitHub Desktop.

Select an option

Save chrisvel/30aefddb5d39310eaf17415b0d06d5db to your computer and use it in GitHub Desktop.
Vagrant provision script for Rails development environment
#!/bin/bash
echo "Provisioning virtual machine"
# Git
echo "Installing Git"
apt-get install git -y
# RVM + 1.9.3 + 2.1.3
echo "Installing rvm + ruby 1.9.3 + ruby 2.1.3"
curl -sSL https://get.rvm.io | bash -s $1
source /usr/local/rvm/scripts/rvm
rvm use --install 1.9.3
rvm use --install 2.1.3
# NodeJS
echo "Installing nodejs"
curl -sL https://deb.nodesource.com/setup | sudo bash -
apt-get install -y nodejs
# Postgresql + Contrib package + Developer dependencies
echo "Installing postgresql + Contrib package + Developer dependencies"
apt-get install -y postgresql postgresql-contrib libpq-dev
# MySQL + Developer dependencies
echo "Preparing MySQL"
apt-get install debconf-utils -y > /dev/null
debconf-set-selections <<< "mysql-server mysql-server/root_password password ***"
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ***"
echo "Installing MySQL + Developer dependencies"
apt-get install -y mysql-server libmysqlclient-dev
# MongoDB
echo "Installing mongodb"
apt-get install -y mongodb
# Redis
echo "Installing redis"
apt-get install -y redis-server
# Other dependencies such as imagemagick, libxslt, etc. Most of them needed by principal ruby gems
echo "Installing imagemagick and rmagick related dependencies"
apt-get install -y imagemagick libmagick++-dev libmagickwand-dev
echo "Installing nokogiri dependencies"
apt-get install -y libxslt-dev libxml2-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment