Skip to content

Instantly share code, notes, and snippets.

@alexanderedge
Created September 16, 2013 09:34
Show Gist options
  • Save alexanderedge/6578500 to your computer and use it in GitHub Desktop.
Save alexanderedge/6578500 to your computer and use it in GitHub Desktop.
Ruby 2.0 + Rails 4.0 Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :forwarded_port, guest: 3000, host: 3000 # rails
config.berkshelf.enabled = true
config.omnibus.chef_version = :latest
config.vm.provision :chef_solo do |chef|
chef.add_recipe "apt"
chef.add_recipe "git"
chef.add_recipe "build-essential"
chef.add_recipe "ruby_build"
chef.add_recipe "rbenv::vagrant"
chef.add_recipe "rbenv::user"
chef.json = {
'rbenv' => {
'user_installs' => [
{
'user' => 'vagrant',
'rubies' => ['2.0.0-p247'],
'global' => '2.0.0-p247',
'gems' => {
'2.0.0-p247' => [
{ 'name' => 'bundler' },
{ 'name' => 'rails' }
]
}
}
]
}
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment