Skip to content

Instantly share code, notes, and snippets.

@ricardogpsf
Last active January 16, 2017 17:01
Show Gist options
  • Select an option

  • Save ricardogpsf/df2fb71d3127842a5a7594daa834ee38 to your computer and use it in GitHub Desktop.

Select an option

Save ricardogpsf/df2fb71d3127842a5a7594daa834ee38 to your computer and use it in GitHub Desktop.
Setup vagrant using shell script for Ubuntu Trusty with Ruby/Rails using Mysql
#!/bin/bash
echo "Provisioning virtual machine..."
# enable console colors
sed -i '1iforce_color_prompt=yes' ~/.bashrc
# disable docs during gem install
echo 'gem: --no-rdoc --no-ri' >> ~/.gemrc
sudo apt-get -y update
sudo locale-gen UTF-8
# install curl
sudo apt-get install curl libcurl3 libcurl3-dev php5-curl
# install rvm
\curl -sSL https://rvm.io/mpapis.asc | gpg --import -
\curl -sSL https://get.rvm.io | bash -s stable
source /home/vagrant/.rvm/scripts/rvm
# install ruby
rvm install 2.3.3
# install debconf-utils for help installation of mysql
sudo apt-get install debconf-utils -y
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password root"
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password root"
# install mysql
echo "Installing mysql-server"
sudo apt-get install mysql-server -y
sudo apt-get install libmysqlclient-dev -y
echo "Installing gems..."
gem install bundler
cd /vagrant
bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment