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. postscripter says:

    Thanks for this great post.
    I really needed a roadmap like this.
    One thing that worried me was:
    “When you’re first starting out, don’t make unusual choices, such as learning to program Rails on Windows”
    I don’t think it is the right time for me to switch OS.
    But I think since you wrote this post, Ruby and Ruby on Rails may have got more and more compatible with Windows. Can you please let me know if you still believe your statement is true, or am I safe working ROR while on Windows now?

  2. techiferous says:

    Hi postscripter,

    I haven’t done web development with Windows since 2007, so I don’t know where the state of Ruby on Rails in Windows is at the moment. It really depends on your goals. If you are aiming to be a professional web developer as a career, then Windows is not a good choice for Rails: go with Linux or Mac OS X. If you just want to get started learning, you can certainly learn using Windows. Some gems may not be compatible with Windows, though.

    Happy coding!

  3. postscripter says:

    thanks for the quick reponse.
    Actually I want to learn fast and consequently create a web app I already have in mind.
    I will try surviving on Windows..I have zero experience on other OSs
    Will also check Iron Ruby.
    http://ironruby.net/

  4. postscripter says:

    Hi
    Thanks.
    I need to add one great resource to learn Ruby which is http://www.rubymonk.com , in my opinion it is much better than http://www.tryruby.org , though I would recommend starting with tryruby to get a fast idea of the language in general (while having fun) then do rubymonk for a more complete view of the language.

  5. Michael Hartl’s Online Guide: http://ruby.railstutorial.org/ is probably the easiest, most comprehensive and up-to-date guide on learning rails. Highly recommended!

  6. Justin says:

    codeStreak is a way to learn Ruby on Rails in 6 weeks.

    http://www.codestreak.com/

  7. vieq says:

    First things first

    I would like to thank you on behalf all the noobs around the world and internets like me on this road map and bringing that around raises a noobish question.

    So Ruby goes in parallel with learning (HTMl -> DNS and hosting / CSS -> *project* -> JS) and all meet with nanoc ?

    or what?

    Sorry, I like specifics.

  8. techiferous says:

    @vieq,

    The idea is that web programming is a combination of two things: web technologies, and programming. Learning Ruby gives you an understanding of the programming, and HTML/CSS/JavaScript/DNS gives you an understanding of the web technologies.

    They really combine into Rails, not nanoc. The reason the track starts with nanoc is that it is working through concepts one by one. Nanoc gets you familiar with mixing Ruby in your view templates. Rack gets you familiar with working with dynamically-generated HTML. Heroku gets you familiar with deploying your app. Sinatra gets you familiar with a basic Ruby web framework that you can grasp all of the parts of, unlike Rails which can seem very big and daunting.

    If you don’t feel you need this step-by-step approach, then learn Ruby in parallel with the web technologies and then jump straight into Rails.

  9. sujith kumar says:

    Hi all, I am new into programming and i’m looking to build a website with a B2B enviornment. I am looking for a support and mentor on this project.

    Sujith my email id is sujithsajitha@gmail.com

  10. techiferous says:

    Hi sujith,

    First, check your city for local tech meetups. I would suggest http://meetup.com or http://rubyusergroups.org to start with.

    Also, get on a mailing list of one of these groups. It’s a great way to learn.

    If you are looking for a mentor, check out http://railsbridge.org

    Happy learning!

  11. Shelby says:

    Hi there! This article is super helpful – exactly what I was looking for. However, it’s a few years old at this point. Would you change your advice or provide any additional resources/tools/courses at this point? Thanks!

  12. techiferous says:

    Hi Shelby,

    Good question! I would say that the roadmap has (surprisingly) stood the test of time and I wouldn’t change much about it.

    Some tweaks: Go ahead and learn HTML5/CSS3 now. Also, in addition to learning a few JavaScript basics, get to know JSON and jQuery. Not knowing these will hold you back.

    Another thing to note (maybe after you’ve gained some confidence with Rails) is that JavaScript is gaining ground as the lingua franca of the web. So if you are learning Rails in order to be a solid web developer, make sure your next step is to get a really firm understanding of JavaScript as a language and get to know some popular JavaScript MVC frameworks.

    There are probably some newer learning resources that have popped up in the meantime, but I don’t know any off the top of my head.

    Thanks for the question!

  13. Khaleel says:

    As someone mentioned, It would be better if you mention why someone should use Rails in first place. Perhaps its because its faster to build/understand Rails. I build my website(www.scraphere.com) on Java framework and it works just great.

  14. This is great. I especially appreciated your five tips at the end. I am thinking of getting one of these together for the open source community I nurture. Thank you for making this.

Leave a Reply