Skip to content
Poignant Guide Ruby Q&A

Should I learn plain Ruby before Rails?

Staff answerWritten by Fenwick Hale · Rails and web development1 replyupdated

Short answer

I would add one thing from my classes: build something tiny in plain Ruby first, such as a text game or a to-do list that lives in a hash. When the same idea later shows up in a Rails model, you will recognize it.

From the top reply by Odile Marchetti ·
CitePoignant Guide Ruby Q&A, "Should I learn plain Ruby before Rails?", https://poignantguide.net/answers/read/should-i-learn-plain-ruby-before-rails/, accessed 2026-11-27.
  1. Staff: gems, Rails, tooling and debugging ·

    Yes, learn some plain Ruby first, but not all of it. A few evenings with variables, methods, arrays, hashes, blocks and one small class is enough to read Rails code without guessing. The official Rails guide itself says it strongly recommends learning the basics of Ruby before you start its tutorial.

    What the Rails guide says

    The Getting Started with Rails guide opens with this: Rails is a web framework built for Ruby, it takes advantage of many Ruby features, and so the authors "strongly" recommend learning the basics of Ruby to understand the terms and vocabulary in the tutorial. It also lists the prerequisites for the tutorial: Ruby 3.2 or newer, Rails 8.1.0 or newer and a code editor. Checked on 12 November 2026; the versions change with releases.

    Rails does not replace Ruby. It is a large library written in Ruby, so every line you read in a Rails app is Ruby, including the lines that look like configuration.

    A Rails line that is plain Ruby

    Rails code often looks like a special language. It is not:

    # in a Rails model you will see something like:
    #   validates :name, presence: true
    # That is a method call. Here is a tiny version you can run in irb:
    
    def validates(attribute, options = {})
      "checking #{attribute}, presence: #{options[:presence]}"
    end
    
    validates :name, presence: true
    # => "checking name, presence: true"
    

    validates is a method. :name is a symbol, a lightweight label that is always the same object. presence: true is a hash of options, a collection of key and value pairs, passed without braces. If those three ideas are unfamiliar, the Rails line looks like magic. If they are familiar, it reads like English.

    What to know before you start

    Ruby idea Where you meet it in Rails
    Symbols and hashes Options everywhere, and params in controllers
    Blocks (do ... end) Route files, migrations and form builders
    Classes and inheritance class Product < ApplicationRecord
    Modules Shared code mixed into controllers and models
    nil and its errors The most common error in a first app
    Gems and Bundler The Gemfile that every Rails app has

    You do not need metaprogramming, threads or the standard library tour to begin. You will pick those up when a real problem asks for them.

    A sensible order

    1. Spend a few sessions in irb with strings, numbers, arrays and hashes. Chapter 3 of the guide is built for exactly this.
    2. Learn what a symbol is: What is a symbol in Ruby, and when should I use one instead of a string?
    3. Learn blocks, because Rails code is full of them: What is a block in Ruby, and what does yield do?
    4. Write one class with initialize and attr_accessor, using How do attr_accessor, attr_reader and attr_writer work in Ruby?
    5. Start the Rails tutorial, and keep irb open in another window for every Ruby line you do not recognize.

    The Poignant Guide's last chapter, When You Wish Upon a Beard, points readers to the official Ruby documentation and the Rails guides as the next step. That is the same order suggested here.

    Mistakes beginners make

    1. Waiting until Ruby feels finished. It never does. Learn the list above, then start Rails.
    2. Skipping Ruby entirely. Copying generator output works for a day. Then an error appears and nothing in it makes sense.
    3. Treating Rails methods as Ruby keywords. validates, has_many and get are ordinary method calls. You can look them up and read what they do.

    Are you ready? Check this in order

    1. Can you write a method with a default argument and call it with and without that argument?
    2. Can you loop over an array with each and a block, and over a hash with each?
    3. Can you read a value out of a hash by key, and say what happens when the key is missing?
    4. Can you define a class with initialize and an instance variable, and make an object from it?
    5. Given undefined method 'x' for nil, can you say what nil means and where to look?

    If the answer to most of these is yes, start the Rails guide. If not, go back to one topic at a time; nothing is lost.

    3
    ReplyLink

Plain text or simple Markdown. Links are nofollow. Your email is never shown.

  1. Odile MarchettiStaffStaff: Ruby basics, objects and the Poignant Guide ·

    I would add one thing from my classes: build something tiny in plain Ruby first, such as a text game or a to-do list that lives in a hash. When the same idea later shows up in a Rails model, you will recognize it. The Dwemthy's Array pages on this site are a fun place to see classes doing real work.

Poignant Guide Ruby Q&A. Questions and answers on learning Ruby and programming: syntax, blocks, objects, gems, Rails, debugging and reading the Poignant Guide.