Saturday, August 29, 2015

Setting up a Ruby env with Vagrant and RVM

0 lượt xem comment 0 comments

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
Tags: command, update, code,

comment 0 comments

Chuyên mục văn hoá giải trí của VnExpress

.

© 2017 www.blogthuthuatwin10.com

Tầng 5, Tòa nhà FPT Cầu Giấy, phố Duy Tân, Phường Dịch Vọng Hậu, Quận Cầu Giấy, Hà Nội
Email: nguyenanhtuan2401@gmail.com
Điện thoại: 0908 562 750 ext 4548; Liên hệ quảng cáo: 4567.