Setting up a Ruby env with Vagrant and RVM

If you use windows and want code in Ruby you need use vagrant or docker because most of libraries does not for for windows at all - same happens for nodejs and python lots of libraries just dont work :(.

I was trying to play with some static site generators like this and this one here. But unfortunately i use windows so vagrant pretty much made my day :-)

This is pretty easy, once you have vagrant installed you just need do $ vagrant up with my Vagrantfile and them the rest will happen under the hood. You just need put RVM in your path because start using ruby - the command is on the Vgrantfile, you just need to source it and thats it.

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "55.55.55.101"
config.vm.synced_folder ".", "/home/vagrant/shared/"
config.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get install -y wget
sudo apt-get install -y curl
sudo apt-get install -y vim
sudo apt-get install -y git
sudo apt-get install -y build-essential
#
# Installs RVM
#
sudo gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
sudo curl -sSL https://get.rvm.io | bash -s stable
sudo su
source /etc/profile.d/rvm.sh
#
# Install Ruby 2.1.x in RVM
#
rvm install 2.1
rvm use 2.1
SHELL
end
view raw Vagrantfile hosted with ❤ by GitHub
Cheers,
Diego Pacheco

Popular posts from this blog

Having fun with Zig Language

C Unit Testing with Check

Cool Retro Terminal