Roadmap for Learning Rails

Accelerating Your Learning

bloodhoundIf you have no prior development experience, one of the worst things you can do when learning Rails is to just dive in. Some of the concepts build on each other, so jumping in would be like signing up for a calculus class before you’ve learned algebra. Sure, you could muddle through it, but most of your time would be spent trying to figure out why things aren’t working.

Another difficulty for a beginner is figuring out what to learn. SQL, XHTML, CSS, XSS, RDF, RDBMS–what should you drink from the fire hose of acronyms? Which topics are worthwhile for a beginner to learn and which are better left for later?

Another mistake is spending too much time mastering a concept when you only need a basic understanding.

Therefore, to accelerate your learning, learn the right things in the right order at the right depth.

The following roadmap will help you do exactly that.

But First Some Ground Rules…

It takes a significant investment of time to learn Rails. It will be months or even years before you are a productive Rails programmer. So don’t make the mistake of choosing Rails when you should be learning something else! Before committing to Rails, you should:

  • know the difference between a web site and a web application
  • know the difference between a CMS and a web application
  • know the difference between a programming language and a web framework
  • know that Rails is a web framework (not a CMS, not a programming language) that helps you create web applications

Otherwise, you will waste your time learning Rails when all you really needed was WordPress.

Update: In addition to this roadmap, you should also check out the very nice screencast Getting Started with Rails.

Roadmap for Learning Rails

Here is a roadmap specially designed for a beginner to navigate their way to Rails mastery. Blue boxes represent technologies and green boxes represent intermediate goals. Arrows represent learning dependencies. Below the roadmap I’ve listed more information about learning each technology.

I’ve intentionally structured this roadmap so that you can learn one thing at a time. That way, you’ll spend more time creating and less time confused.

Learning Rails Roadmap

Ruby HTML CSS JavaScript DNS and Hosting nanoc Rack Heroku Sinatra Rails Git SQL

Ruby

Ruby is the most important technology to know when learning Rails. Take the time to get comfortable with Ruby. If you have never programmed before, this will take a while. Avoid the temptation to skip ahead without Ruby competence. You will pay for it in the purgatory of awful debugging sessions.

Make sure you fully understand object-oriented programming and that the language constructs are second nature to you. Given a programming problem, you should be able to generate several different solutions and explain the strengths and weaknesses of each. You should know how DSLs work. You don’t need to be an expert in Ruby, but you shouldn’t be struggling with basic concepts like each, modules and symbols.

There is no such thing as a good Rails programmer who is not a good Ruby programmer. Your Rails skills can only be as good as your Ruby skills.

Key Concepts
The concepts you will be learning are too numerous to list. Suffice to say that you could make an entire roadmap dedicated to learning Ruby.
Tools
You need a text editor with syntax highlighting; TextMate is a good choice for beginners. If this is your first text editor, don’t let some evangelist talk you into using vim. You can always learn that later.
References
Learn to Program by Chris Pine is an excellent Ruby book for beginners.
try ruby! is a fun way to jump right into Ruby right now.
The Ruby Programming Language is a great in-depth guide. (By the way, the best programming books are from O’Reilly and The Pragmatic Programmers.)

HTML

HTML is a text markup language, not a programming language, which makes it much easier to learn than Ruby. Start by learning HTML 4 and save HTML 5 for later.

Key Concepts
markup, tags, attributes
Tools
The W3C validator can check your HTML for errors.
References
W3Schools has an HTML tutorial as well as an HTML reference.

CSS

Now that you know HTML, use CSS to give it some style. Your goal should be to understand the basics. You should know how to add styles to your web page and understand the box model. After you understand the basics, move on. Lack of CSS knowledge won’t get in the way of learning other concepts.

Key Concepts
box model, selectors, stylesheets
Tools
There is a W3C validator for CSS.
Use Firefox as your development browser and install Firebug, which is a great tool for debugging HTML and CSS in the browser.
Web Developer is another great Firefox add-on that you should install.
References
W3Schools has a CSS tutorial and reference.

DNS and Hosting

Since your goal is to become a web programmer, you should put something on the web. First, you need to know HTML (and optionally CSS to make it pretty). Then you need to find a web host to host your web page. You can usually find one for free or a few bucks a month. Then you need to buy a domain name from a registrar such as Namecheap. Finally, you need to understand just enough about the Domain Name System (DNS) to point your domain name at your web host. (By the way, registrars often provide hosting as well.)

You really don’t need to put something on the web to learn Rails. However, I think it’s a great idea to get something on the web as soon as you can so that you gain the experience that can only come from managing real web sites. You can start small. For example, I launched the world’s smallest web site at instantzendo.com. Publishing something on the web is a great morale booster, too, so do it as soon as you can.

Key Concepts
DNS, registrars, web hosts

JavaScript

You may notice that JavaScript is shown as a learning dependency for nanoc. This is not quite accurate; you don’t need to know JavaScript to learn nanoc. The reason that JavaScript is shown here in the roadmap is that after you’ve gotten comfortable with HTML and CSS, that’s a good time to explore JavaScript.

Your goal should be to learn just the basics. Learn how to load JavaScript files into your web page and how to insert JavaScript directly into your HTML. Learn how you can manipulate the DOM with JavaScript. Learn just enough about JavaScript so that you know what it is and how to use JavaScript that other people have written. That’s all you need to know for now. Later, when you are learning Rails, JavaScript will come up now and then but you won’t need to write any yourself to learn the basics of Rails.

Key Concepts
functions, scripts, DOM
References
W3Schools has a JavaScript tutorial and reference.

nanoc

By now you should be competent in Ruby as well as HTML. nanoc combines these by using Ruby as a tool to help you write static web pages.

nanoc is in no way related to Rails, so you can get away with not knowing it. However, it’s a great next step in the roadmap since it combines Ruby and HTML without adding a lot of additional concepts. It’s also a great tool to have in your toolbox. I use it myself.

The main Rails-related concept you’ll learn here is how to embed Ruby inside of HTML.

Key Concepts
layouts, templates

Rack

With Rack, you are officially leaving the world of web sites and entering the world of web apps. No longer are you sending static HTML files to the browser; you are programmatically building HTML on-the-fly to send to the browser.

Rack is a great foundational concept. It forces you to understand HTTP, which is required if you are going to be a good Rails developer. Rack is also the technology that every modern Ruby web framework and web server uses, so time spent learning Rack is time well-spent.

Note that you don’t need to know nanoc to learn Rack; Rack is simply a good next step after you know nanoc.

Key Concepts
HTTP, dynamically-generated web pages
Tools
Firebug allows you to see the HTTP conversation between your browser and the web server.
References
I learned Rack from remi’s screencasts and would wholeheartedly recommend you do the same.

Git

Git has no learning dependencies, so you can learn it whenever you want. But you need to know it before you use Heroku.

Git is a version control system so it basically helps you keep track of changes to your files. Don’t underestimate the learning curve of Git. There are a lot of concepts to learn and some of the commands are counter-intuitive. Take the time to understand Git well; it will pay off later. But don’t bother learning everything about Git. Learn what you need to know to manage a typical Git workflow. Note that if you are working by yourself, your workflow will be different than those working in teams.

Key Concepts
version control systems
Tools
If you are on a Mac, GitX is a nice visual interface. But don’t use this instead of Git’s command line interface; use this to augment the command line interface.
GitHub is the home for the Ruby community’s open-source projects.
References
The Git Community Book

Heroku

Heroku is your friend. They are saving you the trouble of learning how to administer a Linux web server. And they are helping you for free. You should give them a hug.

Now that you know Rack and Git, you are dangerous. Write a Rack app, put it in a Git repository, then push this Git repo to Heroku and they will put it on the web for you. You will have published your first web app. Welcome to the club, fellow web programmer!

Because you haven’t learned about databases yet, you will be limited in the kinds of Rack apps you can create. However, you can still write a useful Rack app without a database. My 2rgb.com Rack app (which is hosted on Heroku) is simply a Ruby method wrapped up as a web app. If you’re curious, here’s the source code.

Heroku is not just good for learning and for Rack apps, it’s also good for production Rails apps.

Key Concepts
awesomeness

SQL

Almost all web apps are backed by a database and most of these databases are RDBMSs that understand SQL. Take the time to learn the basics of SQL: what a relation is, SELECT statements, etc. But don’t get too deep–Rails hides the SQL from you so you don’t need to know much in order to learn Rails. However, you should become more familiar with SQL later in order to write professional web apps.

You may hear a lot of discussion about NoSQL. Save that for later after you’re comfortable with Rails, since most Rails apps still use RDBMSs.

Key Concepts
RDBMS, SQL

Sinatra

Sinatra is a simple Ruby web framework that is much easier to learn than Rails. The first thing to do is convert a Rack app you wrote into a Sinatra app. Then create a database and use ActiveRecord to interact with your database from within Sinatra.

You don’t need to know Sinatra to know Rails. However, it makes it easier to learn Rails since it introduces you to web frameworks without the complexity of Rails. Sinatra is also a nice web framework to know and later on you may prefer Sinatra to Rails for some projects.

Key Concepts
web frameworks, ORM

Rails

It is common to feel disoriented when learning Rails. The framework does so much for you and there is so much magic that it’s hard to understand the flow of control and how the different parts of the framework relate. However, if you’ve followed this roadmap, this shouldn’t happen to you.

Key Concepts
Ruby on Rails, MVC
References
Check out the comprehensive Ruby on Rails Tutorial: Learn Rails by Example by Michael Hartl.
Agile Web Development with Rails is a popular Rails tutorial book.
RailsCasts are an excellent way to learn about various Rails topics.

Five More Tips to Accelerate Your Rails Education

...but don't go too fast.

...but don't go too fast.

Always Be Producing
When you are learning a new technology, always create something with that technology. Are you learning HTML? Make a web page. Learning Rack? Launch a tiny web app. Producing something real keeps you focused on learning the right things. Learn by doing.
Don’t Learn Alone
Watch experts as they work. Notice what tools and technologies they use. Pair program.
Know Why It Exists
Every technology was invented to solve a problem. When you learn a new technology, learn who invented it and what problem they were solving. Things will make a lot more sense when you do this.
Follow the Crowd
When you’re first starting out, don’t make unusual choices, such as learning to program Rails on Windows. One of the strengths of Rails is the community, but if you’ve made unusual choices, you’ll quickly find yourself without much help.
Organize Your Knowledge
As you are learning Rails, you’ll encounter an enormous amount of information. Create a system to organize this information so that you can quickly find it later. The act of classifying this information aids your learning.
You can skip to the end and leave a response. Pinging is currently not allowed.

64 Responses to “Roadmap for Learning Rails”

  1. Nice article.

    I might consider cutting out some of the cruft though – nanoc, sinatra, rack… a lot of people won’t ever need to use this stuff, and you can spend years mastering html, css, javascript, ruby, rails, and sql.

  2. Stefan Kroes says:

    What about RailsCasts? I think those are an amazing way to learn Rails. Accessible, free and of high quality.

  3. techiferous says:

    Thanks, Scott. I totally get what you’re saying. This roadmap has a couple of assumptions, though: the person starting it has no prior programming experience and the goal is not a familiarity with Rails but a mastery of Rails.

    If you already have some development experience, especially web development experience, then it makes sense to skip over nanoc and Sinatra. If not, I’ve carefully chosen these technologies to introduce one concept at a time to beginners. It is my belief that the fastest way to learn is to focus on one thing at a time. I’ve also chosen the steps so that you can produce something working at the end of each one.

    The path from Rack to Sinatra to Rails is intentional. It’s too easy for newbies to get lost in the magic of Rails. By starting small and growing the concepts, beginners will have a better feel of the architecture of Rails, how different components relate to each other, and–most importantly–why they exist in the first place.

  4. techiferous says:

    Great suggestion, Stefan. I added a link to RailsCasts in the post.

  5. Matthew says:

    Thanks for this – just what I’ve been looking for.

  6. Excellent article! I appreciate that you don’t understate the difficulty of the learning process. Perhaps you should consider balancing that out with a little exposition about why one would want to learn Rails in the first place.

  7. techiferous says:

    Thanks, Phil, and good suggestion about explaining why someone would want to learn Rails in the first place. I actually feel ill-qualified on that topic. :)

  8. Mark Essel says:

    Howdy Techiferous!
    Appreciate the strategic learning plan for newcomers to Rails as I’m still learning more about web programming each day (I haven’t watched Remi’s screencasts).

    A good friend had just begun exploring the basics of modern scripting and it’s relation to web apps so I tried to cobble everything together into one post. The firehose was a bit much, so I’ll forward both he and another friend to this plan.

    Thanks for thinking this through from a newcomers pov.

  9. Mario says:

    I learned Rails as my first programming language. Looking back on my own reservations, hang-ups and attempts to teach other non-programmers rails, I don’t think this learning approach will be successful for most non-programmers.

    The first question I think is: Who wants to master Ruby/Rails and related technologies? Very few who aren’t already developers – at least not at first. We’re all cognitive misers. Most people want to learn the minimum to get the job done. Also, for a complete newbie, learning is usually optional. People need to be encouraged to learn a little and then keep building.

    For example, when I’ve taught others CSS/HTML, I used to start with big overviews and then moved forward. Now, I found it’s much more successful to give people the tiniest bits of information they need to do something and then building from there. People learn better when they are eager to learn.

    Once they start investing some time learning or trying to build their own application, they’ll do what they need to do to keep up. Figuring out how to deploy to Heroku is a minor step once you’re already on the path, but as yet another whole additional thing to learn, it’s intimidating to non-programmers. In my case, it wasn’t until I was knee deep that I started pushing myself toward any level of mastery. When I got going, I learned Rails as I needed it when I needed it.

    Ruby/Rails can be learned concurrently. While I knew CSS/HTML and basic JS, I started with the framework not understanding the difference between ruby and rails. At first, I struggled with some ruby syntax, but after I spent a day focused on Ruby basics, I stopped having that problem. I built my knowledge incrementally. This approach may not be for everyone, but I believe it is more likely to encourage continued learning.

    It wasn’t until after I learned Ruby/Rails, that I needed and started using GIT, picked up JS and over the past three-four years grew to be a decent all around rails developer. My best learning has come from working with other developers on larger projects. As I’ve learned these things, it’s made picking up related technologies nearly trivial. Sinatra and mongoDB were a sneeze to pick up.

    If you really want to encourage total newbies to learn Ruby on Rails or any language, you need to provide them with as many tangible benefits along the way. If they take baby steps and can see their success, they will constantly be motivated to continue and (hopefully) to improve.

  10. James says:

    “With Rack, you are officially leaving the world of web sites and entering the world of web apps. No longer are you sending static HTML files to the browser; you are programmatically building HTML on-the-fly to send to the browser.”

    That’s simply untrue.

  11. techiferous says:

    James, could you elaborate? Are you saying it is untrue because it’s possible to use Rack to serve static files? Or are you saying that I’m confusing dynamic HTML with web applications?

  12. Ryan Bigg says:

    This is great!

    You left out the Pro Git book though, http://pro-git.org. The first few chapters teach you the basics of Git.

  13. Cristina says:

    Great post. This surely would have been way helpful when I started and it is still good for me now. Funny enough, I am one of those n00b programmers that started learning Rails without the Ruby to back it up. I’m now trying to correct that.

  14. taelor says:

    Great article, though your timing could have been a little better for me. $)

    I have just recently started to work on lesson plans for teaching people how to develop web applications using Ruby on Rails. I had this roadmap about half-right, but i think I missed alot in between the Ruby/HTML/CSS => Rails.

    I remember when I first started trying to learn Rails. After reading a book and some tutorials, I realized something. I had no clue how HTML and CSS really worked (I was a Sophomore in college at the time), much less Ruby as a programming language. So I started to learn HTML and CSS on my own, while any homework for school I did in Ruby.

    After all that I started to create some semi-dynamic websites using ERB and ended up creating my own “framework” for a web application. After I had done that, I then knew I was ready for Rails.

    Hope you don’t mind, but I think I might use some of this Roadmap when creating the rest of our Lesson Plans. I really think this incremental approach will work out great for people who have never built a website or anything before. Thanks for the post!

  15. techiferous says:

    taelor, I really enjoyed reading your comment and I’m glad this post was helpful. In a former life I was a high school programming teacher, so I can totally relate. You (or anyone else) can use anything they want from my blog for educational purposes without specific permission from me.

  16. Antonio says:

    This is a fine and sweet article. I say this from the heart :)
    I’ve been learning rails in the past 2 years and had to find out my personal roadmap from bumping my head on the table every now and then. And that was quite often to be honest.

    I specially like the tip on “please don’t go learning rails on windows”. Doing rails on windows is like going for the marathon by shooting yourself on the foot.

    The “newbies getting lost on the magic stuff that happens” will happen. For me at least (I had NO experience on programming). And although some of feeling was great, it wouldn’t last until I figure out what was going on.

    The railstutorial.org is also a good source of learning material, I think.

    Take care.

  17. Excelent work! I’ll try to follow these steps, i have a little bit of some topics. For me is really difficult to find begginer up to date info about rails.

    I have a doubt: Do you think that TDD/BDD should be included on this roadmap?, maybe Rspec, Cucumber (both), etc? It’s really important?

    Greetings from Chile!

  18. Luke says:

    This is a helpful post for me as I’m actually in the middle of trying to teach myself Rails starting from . I have a couple of comments/questions.

    1. As you suggested I started with teaching myself HTML, CSS, SQL and Ruby. Some programmer friends of mine also suggested learning the Command Line, which I thought was very helpful for a beginner. Having only ever worked with a GUI, the Mac Terminal made much more comfortable dealing with the “guts” of my computer as well as learning the file structure, etc.

    2. In May I lost my job and had a baby (I knew both things were going to happen about nine months ahead of time.) I decided to live off savings for a little bit and dive into Rails. I would love to make a future career of working with Ruby/Rails even if it’s not my next job. I wonder if you could follow up on this post about where someone should be to gain a level of “employability.” Looking at job boards you see a lot of ads for “rockstars”, is it possible to find work as a junior level Rails programmer and continue to learn as you work?

  19. Bragaadeesh says:

    What a beautiful article!!!

    Thank you very much for presenting things so clearly and crisply. It sure was an informative read. I am into Ruby/Rails only for the past couple of months and both are very fresh to me. But I have a clear cut idea of OOPS and web framework as I have worked in Java/J2EE for 4 years.

    I have started development into rails but I find my development time being very slow. I wanted to set things right, as in learning Ruby basics first and get to know how to exploit Rails and accelerate my development. And bam! I found this article.

    Prior this article, I had no idea of what github/heroku/sintara is, now i know something about them :) Happy happy

    Thank you very much!
    Keep up the good work coming!!

  20. techiferous says:

    @Bernardo: I intentionally left testing out of the roadmap. This is part of my strategy of learning one new concept at a time. That said, after Rails (or Ruby) “clicks” with a learner, they shouldn’t postpone the testing topic for too long. It’s important.

    @Luke: 1. I couldn’t agree more and should have more explicitly called out the need to understand how to work with the command line. But I think in the course of learning you’ll be forced to anyways.

    @Luke: 2. It is possible to find jobs as a junior Rails developer and continue to learn as you work. However, it’s harder to get those jobs as there are plenty of people wanting to get into Rails who haven’t mastered it yet. One of the best ways to be employable is to have a good portfolio, so a goal of learning could be to get to the point where you launch your own Rails web app.

  21. Nice roadmap, I recently dove into ruby and was thinking about making my way to rails but I think theres a point in trying to follow your advice here. I will probably glance over some of the subjects if they don’t interest me since I have done development in a few languages and platforms before. But the advice to incrementally build myself towards a scaffolding framework will hopefully let me spend less time looking in the rails source to understand what some things are.

    Great post!

  22. Bladimir says:

    How about adding as part of the initial stages of the roadmap an understanding of what MVC is, you are suggesting to learn HTML you so we can assume MVC is not on top of the head the people who read this.
    I have heard from people coming from the .NET world trying to dig into RoR something like “what the heck is MVC?? Microsoft Visual something???”

    Nice article btw!

  23. techiferous says:

    Thanks, Bladimir! Yes, I agree, understanding MVC is fundamental to understanding Rails. The roadmap is not really a collection of fundamental concepts as much as a sequence of technologies that will give you an easier path to understanding Rails. So when you finally do get to Rails, you can focus on learning MVC and won’t be tripped up by not knowing HTML, Ruby, etc.

    And for those who are reading these comments and seeing MVC for the first time, MVC is a type of software architecture called Model-View-Controller.

  24. Rails 3 RC is out now… if I have to start a project while I’m learning Rails, what do you recommend?, stay on Rails 2.3.8 for a while or maybe start putting hands on Rails 3? I’m talking about developing a new project (a sales management system). Bundler, ActiveModel, and other features promises.

  25. techiferous says:

    That’s a hard call, Bernardo. Rails 3 is certainly stable enough to develop on but the question is whether there are enough learning materials geared toward Rails 3. I think the answer to that question is maybe. railstutorial.org should be updated for Rails 3 soon, there are already a lot of Railscasts for Rails 3, and there is a beta release of the Rails 3 version of Agile Web Development with Rails book from the Pragmatic Programmers.

    That said, there are still some rough waters in Rails 3 around gem compatibility ( see http://railsplugins.org/ ) and getting the right Ruby version ( RVM can help you with this http://rvm.beginrescueend.com/ ).

Leave a Reply