/vagrant-chef-rails4

Rails dev box using Vagrant, Ubuntu Trusty 32-bit (14.04), Ruby 2.1.2, Rails 4.1.1

Primary LanguageShell

Riverside Ruby Rails Dev Box

This repo uses Vagrant to create a Ruby on Rails development environment on a Windows, Mac, or Linux computer. With one command, you can create a virtual Ubuntu Linux box (Trusty Tahr 14.04). Vagrant creates Linux web servers on their local machines, while allowing them to use native tools like Notepad++ and TextMate). For Windows users, this means using the latest Ruby and Rails, which are unavailable natively.

Dependencies

There are three major dependencies: Git, VirtualBox, and Vagrant. All are free software. Additionally, there are a few Vagrant plugins required: vagrant-vbguest and vagrant-librarian-chef.

Windows Installation

Download and install the following. If there are options, just choose default values.

  1. Git v.1.9.4
  2. VirtualBox
  3. Vagrant
  4. Open the Git Bash application
  5. Install vagrant-vbguest by typing: vagrant plugin install vagrant-vbguest
  6. Install vagrant-librarian-chef: vagrant plugin install vagrant-librarian-chef
  7. Clone this repository: git clone https://github.com/Riverside-Ruby/vagrant-chef-rails4 rrug
  8. Change to the rrug folder: cd rrug
  9. Create the Rails box: vagrant up
  10. Have a meal. Installation takes about 25 minutes with a fast Internet connection and a 2014 MacBook Pro running Windows 7 Professional. Yours might take longer. Don't worry if it seems to hang at stdin: is not tty. Remember that you are installing an entire operating system and the latest Ruby, Rails, and Ember-CLI.
  11. When installation is finished, start your servers.

Mac/Linux Installation

  • Follow the instructions above, but feel free to use Homebrew to install Git instead of using the binary installer. Also, you may have to input your password to allow the NFS exports. If you have problems, talk to Judd, Matt, or Jack.

Start the servers

Vagrant uses SSH to allow direct control of the virtual machine. Follow the steps below to start your Rails and your Ember servers.

  1. SSH into your vagrant machine from your command line (Git bash): vagrant ssh
  2. Start a Tmux session: tmux new-session
  3. Split your terminal window with Tmux: tmux split-window -v (top/bottom) or tmux split-window -h (side-by-side), or use Ctrl+b, then hit " (top/bottom) or % (side-by-side)
  4. Start your Rails server: cd /vagrant/rails && rails s
  5. Select the other pane: Ctrl+b, then arrow key
  6. Start your Ember server: cd /vagrant/ember && ember s --proxy http://localhost:3000
  7. In a web browser, load http://localhost:3001 for your Rails app or http://localhost:4201 for your Ember app. The Vagrant configuration forwards port 3000 and 4200 (the default values) to 3001 and 4201 respectively to avoid port number conflicts.
  8. To stop the servers, use Ctrl-C, then type exit to close each pane and window.