Skip to content

Instantly share code, notes, and snippets.

@KumarL
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KumarL/c689238df92a895776d6 to your computer and use it in GitHub Desktop.
Save KumarL/c689238df92a895776d6 to your computer and use it in GitHub Desktop.
Minimalist vagrant shell provisioner for rails app
# Use this shell provisioner in Vagrant to set up a minimalist environment for rails app
# You can add further customization to install postgres/mysql db
# Look up the steps at: https://gorails.com/setup/ubuntu/14.04
# enable console colors
sed -i '1iforce_color_prompt=yes' ~/.bashrc
# Install build essentials
sudo apt-get -y update
sudo apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
# set up rbenv
cd
git clone git://github.com/sstephenson/rbenv.git .rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
exec $SHELL
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL
git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
# install ruby 2.2.1
rbenv install 2.2.1
rbenv global 2.2.1
ruby -v
echo "gem: --no-ri --no-rdoc" > ~/.gemrc
gem install bundler
# install nodejs
sudo add-apt-repository -y ppa:chris-lea/node.js
sudo apt-get -y update
sudo apt-get install -y nodejs
# install rails
gem install rails -v 4.2.0
rbenv rehash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment