The words Under construction in black text on a yellow background with diagonal black stipes surrounding it
I'm in the process of moving my site. It's still a work in progress. Please excuse the mess and broken links.

Vagrant setup for The Ruby on Rails Tutorial

TODO: Pull subtitle into page object

TODO: Figure out timing. TODO: Put in note about how you don't have to do 'bundle install --without production' and can just do 'bundle install'

The second edition of Michael Hartl's _The Ruby on Rails Tutorial_^1^^ was my Rails inauguration. It was an excellent way to get grounded in the framework^2^^ and got bonus points for demonstrating solid development best practices (e.g. version control via Git and Test Driven Development).

Last October, the third edition came out. It has a few enhancements that caught my eye:

- Built on the latest major version of Rails (4.2) - MiniTest instead of RSpec for testing - Updated login/auth section - Account email/activation examples - Cloud storage examples

More than enough to make it worth going through the new edition.

My first step, as a Vagrant^3

code_start_default_section code_end_default_section

A simple `vagrant up` on that file on a recent Mac running Vagrant 1.7.2 will build and fire up a 64-bit Ubuntu 14.04 LTS box with everything needed to run through the tutorial including Rails 4.2.0 running on Rails 2.2.1 via RVM^6^^. It even does the network mapping so that a Rails server process running on the default 3000 port in the Vagrant box shows up at http://localhost:8080/ on your machine.

Anyone interested in knowing more about what all the various calls are for can check out this follow up.

Or, just run the file and enjoy working through the tutorial without the headache of setting up a local environment.

_Footnotes_

1. _The Ruby on Rails Tutorial_ by Michael Hartl - There are a few ways to do the tutorial. The cheapest is to go through it for free online. It's great, but I recommend paying for the book and the videos. It was totally worth it for me to be able to hear Michael walks through everything.

2. The Tutorial is great if you've got a little coding experience under your belt. If you're a complete beginner, bookmark it to come back to after you've gotten your feet a little wet somewhere else. (I'm still looking for the a "Start Here" recommendation I feel comfortable with for complete beginners. I'll post about it when I find it.)

3. Vagrant

4. A Vagrantfile is simply the configuration file that tells the Vagrant software how to build the virtual machine.

5. I skimmed the tutorial for anything that should be included in the Vagrantfile. I got everything obvious. I'll add anything I missed as I actually make my run through the tutorial.

6. TKTKTKTK RVM

Debugging Stuff

I'm moving stuff around right now. All this below is helping me figure out where to put stuff

        -- title

Vagrant setup for The Ruby on Rails Tutorial

-- p

TODO: Figure out timing.
TODO: Put in note about how you don't have to do 'bundle install --without production' and can just do 'bundle install'

-- p

The second edition of Michael Hartl's _The Ruby on Rails Tutorial_^1^^ was my Rails inauguration. It was an excellent way to get grounded in the framework^2^^ and got bonus points for demonstrating solid development best practices (e.g. version control via Git and Test Driven Development).

-- p

Last October, the third edition came out. It has a few enhancements that caught my eye:

-- p

- Built on the latest major version of Rails (4.2)
- MiniTest instead of RSpec for testing
- Updated login/auth section
- Account email/activation examples
- Cloud storage examples

-- p

More than enough to make it worth going through the new edition.

-- p

My first step, as a Vagrant^3</sup> user, was to make a Vagrantfile<sup>4</sup> to create and configure a virtual machine for the tutorial<sup>5^^. Writing it was a lot tricker than expected. I'm posting it here in hopes it keeps others from having to go through the bug hunting calisthenics I did.

-- p

-- hr

-- code/
-- ruby

TKTKTKT - Insert final version of the Vagrantfile when everything is edited.

-- /code

-- p

A simple `vagrant up` on that file on a recent Mac running Vagrant 1.7.2 will build and fire up a 64-bit Ubuntu 14.04 LTS box with everything needed to run through the tutorial including Rails 4.2.0 running on Rails 2.2.1 via RVM^6^^. It even does the network mapping so that a Rails server process running on the default 3000 port in the Vagrant box shows up at <<link|http://localhost:8080/|http://localhost:8080/>> on your machine.

-- p

Anyone interested in knowing more about what all the various calls are for can <<link|check out this follow up|/vagrant-setup-for-ruby-on-rails-tutorial-part-2>>.

-- p

Or, just run the file and enjoy working through the tutorial without the headache of setting up a local environment.

-- p

_Footnotes_

-- p

1. _<<link|The Ruby on Rails Tutorial|https://www.railstutorial.org>>_ by Michael Hartl - There are a few ways to do the tutorial. The cheapest is to go through it for free online. It's great, but I recommend paying for the book and the videos. It was totally worth it for me to be able to hear Michael walks through everything.

-- p

2. The Tutorial is great if you've got a little coding experience under your belt. If you're a complete beginner, bookmark it to come back to after you've gotten your feet a little wet somewhere else. (I'm still looking for the a "Start Here" recommendation I feel comfortable with for complete beginners. I'll post about it when I find it.)

-- p

3. <<link|Vagrant|https://www.vagrantup.com/) is an excellent, open-source way to manage Virtual Machines. (For those unfamiliar, using a Virtual Machine is like having a second, full-blown computer running _inside_ your actual computer. Something that's awesome when, for example, you need to work on a Linux machine but happen to be running Windows.) I repeatedly find myself wishing I'd had Vagrant when I was getting started. It makes so many fiddly, not-relevant-to-what-your-actually-trying-to-do problems simply disappear. I'm so happy that beginners today have access to it. (Not to mention pros who get even more benefit out of it.>>

-- p

4. A Vagrantfile is simply the configuration file that tells the Vagrant software how to build the virtual machine.

-- p

5. I skimmed the tutorial for anything that should be included in the Vagrantfile. I got everything obvious. I'll add anything I missed as I actually make my run through the tutorial.

-- p

6. TKTKTKTK RVM


-- categories
-- Misc

-- metadata
-- date: 2015-05-28 00:00:00
-- id: 20en3uvh
-- status: published
-- type: post
-- SCRUBBED_NEO: false
-- site: aws