/rails_box

Primary LanguageRuby

A Virtual Machine for Ruby on Rails Development

Introduction

This project automates the setup of a development environment for working on Ruby on Rails itself. Use this virtual machine to work on a pull request with everything ready to hack and run the test suites.

Please note this virtual machine is not designed to be used for Rails application development.

Requirements

How To Build The Virtual Machine

Building the virtual machine is this easy:

host $ git clone git@github.com:tez/rails_box.git PROJECT
host $ berks vendor cookbooks
host $ vagrant up --provision
host $ vagrant ssh
guest $ cd /vagrant
guest $ mv APPNAME YOUR_PROJECT
guest $ cd YOUR_PROJECT

guest $ bundle install --path .bundle
guest $ bundle exec rails new .

That's it.

(If you want to use VMWare Fusion instead of VirtualBox, write vagrant up --provider=vmware_fusion instead of vagrant up when building the VM for the first time. After that, Vagrant will remember your provider choice, and you won't need to include the provider flag again.)

(If you want to use Parallels Desktop instead of VirtualBox, you need Vagrant 1.5+, and write vagrant up --provider=parallels instead of vagrant up when building the VM for the first time. After that, Vagrant will remember your provider choice, and you won't need to include the provider flag again.)

If the base box is not present that command fetches it first. The setup itself takes about 3 minutes in my MacBook Air. After the installation has finished, you can access the virtual machine with

host $ vagrant ssh
Welcome to Ubuntu 14.04 LTS (GNU/Linux 3.13.0-24-generic x86_64)
...
Last login: Mon Aug  4 14:51:44 2014 from 10.211.55.2
vagrant@trusty64:~$

Port 3000 in the host computer is forwarded to port 3000 in the virtual machine. Thus, applications running in the virtual machine can be accessed via localhost:3000 in the host computer.

What's In The Box

  • Nginx

  • ImageMagick

  • Git

  • rbenv

  • Ruby 2.2.3 (binary rbenv install)

  • Bundler

  • Sqlite3 or MySQL

  • System dependencies for nokogiri, sqlite3

  • Databases and users needed to run the Active Record test suite

  • Node.js for the asset pipeline

  • zsh

  • git-flow

  • tmux

  • vim

License

Released under the MIT License, Copyright (c) 2014 tez.