The Rails Tutorial, Chapter 1: From zero to deploy

Matt Lawrence
4 min readMay 24, 2017

--

In my first post on medium, Why I’ve Been Afraid to Write, I wrote that it’s “time to stop the coding lessons and tutorials and build something.” Even as I wrote that, I knew that the one exception to this would be Michael Hartl’s Rails Tutorial. In the world of developers, most things are debatable. Programming languages, frameworks, operating systems, Git version control systems, and even tabs vs. spaces all have passionate defenders for good reasons. Each could be the best solution to the current problem depending on the context. Rails allows for rapid development but slower processing speeds. Bitbucket allows for unlimited private repositories but doesn’t have the following of Github. The one thing that I haven’t heard debated is that the most thorough tutorial for learning Ruby on Rails is Michael Hartl’s Rails Tutorial, commonly referred to as “The rails tutorial.” After working through the first of fourteen chapters this morning, I can already see why.

In Chapter 1: From zero to deploy, I’ve already accomplished something that I failed to accomplish in my 3 months of Treehouse lessons or my code immersion bootcamp with Tech Talent South: I built an app, modified it safely using Git, and deployed it live on the web using Heroku. While this was just another simple and obligatory “hello, world” app, the real genius behind Hart’s method is introducing the student to the process as a whole in the first day. There’s something empowering about deploying an app that you built to the web so quickly. It makes you realize that even though there’s so much more to learn, you’ve already done what seemed impossible only a couple of hours ago. It really makes you feel like a developer, and if you take a few minutes to customize your look in Cloud 9, you’re basically Mr. Robot.

Black background = Master Hacker

Speaking of Cloud 9, that was probably my favorite new piece of info in this chapter. In all of my prior coding, I had either used the text editor built into the course like in Treehouse or Codecademy, or I had just used my local machine. This tutorial recommends using a pre-configured cloud environment, and I have to say, this made getting started a breeze. It also allows me to code on my PC laptop as if I’m using a Mac, which will save me the $2k+ of buying a Macbook Pro for a while. I can continue to work on my wife’s iMac for the most part and take my PC to any Meetups without having to learn an entirely new command line.

This chapter also recommends using Bitbucket over Github when you’re starting out. This is strictly for security purposes and cost as Bitbucket allows for private repos in their free tier while Github requires an upgrade for private repos. Hartl’s reasoning for starting with private repos is that they “might contain potentially sensitive information such as cryptographic keys or passwords, which could be used to compromise the security of a site running the code.” There are ways to work around this, of course, but I’m way too much of a newbie to understand all of that so I’ll just keep it private for now. You could also just pay the $7/month for private repos in Github, and this comes with the added advantage of showing your daily commits while working through the tutorial (something most hiring managers look for), but I’ll just stick with Bitbucket for now and make an informed decision after the tutorial having had exposure to both.

While I have had some previous exposure to Heroku, this tutorial made me realize why Rails developers love it so much. It is built with the sole intention of making you a deploying machine. Putting your app live on the web is free, easy, and incredibly motivating. I’m kind of blown away that we never did this in any of my Treehouse or TTS courses, but I’m glad to know about it now. I will definitely be using this as my primary method for building and deploying prototypes. Again, something as simple as a “hello, world” app live on the web can make you really feel like a developer, even with so much more to learn.

While he didn’t go too deep into the subject, Hartl has already introduced the concept of Model-View-Controller (MVC), which is the backbone of the Rails framework. It’s also something I struggled with throughout my bootcamp. In both Treehouse and TTS, the protocol was to first learn Ruby, a programming language, and then Ruby on Rails, a framework for Ruby. While I do think some basic prior knowledge of Ruby is helpful, introducing the big picture concept of Ruby on Rails first really helps make the subject more approachable. I’d spent months learning Ruby with Treehouse and TTS, only to abruptly switch to Ruby on Rails one day. The programs I’d written in Ruby really weren’t suitable for Ruby on Rails so I felt like I was back at square one rather than following a natural progression. While only through Chapter 1 of this tutorial, just browsing the chapter headlines gives me hope that this progression will better suit my learning style and bring all the pieces of the puzzle together more fluidly.

My plan is to work through a chapter every day, writing a summary of what I learned after each one to really internalize the lesson. Having said that, it’s raining like crazy outside, my wife and I are basically just waiting for our son to be born (the subject of many future posts, I’m sure), and I’m inspired to move on to Chapter 2: A toy app. Onward and upward!

--

--

Matt Lawrence

Husband to 1, father of 2, logistics expert, marketing ninja, real big dude.