Should I learn plain Ruby before Rails?
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.
Cite
Poignant 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.- Fenwick HaleStaffStaff: 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"validatesis a method.:nameis a symbol, a lightweight label that is always the same object.presence: trueis 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 paramsin controllersBlocks ( do ... end)Route files, migrations and form builders Classes and inheritance class Product < ApplicationRecordModules Shared code mixed into controllers and models niland its errorsThe most common error in a first app Gems and Bundler The Gemfilethat every Rails app hasYou 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
- Spend a few sessions in irb with strings, numbers, arrays and hashes. Chapter 3 of the guide is built for exactly this.
- Learn what a symbol is: What is a symbol in Ruby, and when should I use one instead of a string?
- Learn blocks, because Rails code is full of them: What is a block in Ruby, and what does yield do?
- Write one class with
initializeandattr_accessor, using How do attr_accessor, attr_reader and attr_writer work in Ruby? - 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
- Waiting until Ruby feels finished. It never does. Learn the list above, then start Rails.
- Skipping Ruby entirely. Copying generator output works for a day. Then an error appears and nothing in it makes sense.
- Treating Rails methods as Ruby keywords.
validates,has_manyandgetare ordinary method calls. You can look them up and read what they do.
Are you ready? Check this in order
- Can you write a method with a default argument and call it with and without that argument?
- Can you loop over an array with
eachand a block, and over a hash witheach? - Can you read a value out of a hash by key, and say what happens when the key is missing?
- Can you define a class with
initializeand an instance variable, and make an object from it? - Given
undefined method 'x' for nil, can you say whatnilmeans 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.
Write something first.
Give people something to work with: at least 30 words on what happened and what you tried.
That is too long. Keep it under 6,000 characters.
Write the question as the title, 15 to 140 characters, no links.
Pick a category.
Add a name (2 to 40 characters, no links).
That email address does not look right.
That was quick. Read the thread, then try again.
The form expired. Reload the page and post again.
Something went wrong with the form. Reload and try again.
Please complete the check and post again.
Limit reached for now. Try again later.
This thread is closed to new replies.
This thread no longer accepts replies.
Something went wrong with the form. Reload and try again.
Post a reply or question first (name and email), then this browser can vote, edit and accept answers.
You cannot vote on your own post.
Only the author (within 30 days) or the forum team can do that.
That email already has an account. Use your sign-in link instead.
New accounts are paused for the moment. Try again later.
That was already posted.
1 answer
- 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.