I think learning Ruby has three parts:

1. OOP + SOLID in Ruby
    
2. Ruby Syntax
    
3. Idiomatic Ruby
    

What follows assumes you already know how to program in any other programming language. If this is the first time you are learning to code, then that is another path and I will write about it some day.

I would start in the following way:

1. Ruby Syntax: First, read a bit about the Ruby syntax. You can find a short introduction to Ruby. I tried to collect a lot of resources [here](https://ghinda.com/blog/programming/ruby/2021/learning-ruby.html#learning-ruby-where-and-how), but you can also find some resources [here](https://rubyandrails.info). Do some small exercises if you feel like it just to get the syntax. A good book to read that explains the syntax of ruby is [Programming Ruby 3.3](https://pragprog.com/titles/ruby5/programming-ruby-3-3-5th-edition/). Another great resource to keep open while you learn the Ruby syntax is [the Ruby official documentation](https://docs.ruby-lang.org/en/3.3/).
    
2. Watch some videos of Sandi Metz. Here is a [list of Sandi Metz videos](https://www.youtube.com/results?search_query=sandi+metz) for that. I recommend starting with [SOLID Object-Oriented Design by Sandi Metz](https://www.youtube.com/watch?v=v-2yFMzxqwU). Some things might make sense, some not. No worries, this is just a kind of priming your way of thinking about how to code in Ruby
    
3. After watching one video go ahead and try to work [on some learning project](https://allaboutcoding.ghinda.com/projects-ideas-for-learning-ruby-or-any-ruby-web-framework) in Ruby. Do the first version of that that should work. Here is an example: Do an ATM simulator in Ruby. Or a Daily Quote CLI that should serve one quote daily. Find more examples of projects I recommend for learning [here](https://allaboutcoding.ghinda.com/projects-ideas-for-learning-ruby-or-any-ruby-web-framework)
    
4. Push that project to Github and Gitlab.
    
5. After you do the first version, install Minitest and try to redo that project but TDD style. So first, you will write a test and then make that test pass. Do this on a separate branch and open an MR/PR with it.
    
6. Now, after you rewrote that project with tests, go ahead and rewatch the SOLID Object Oriented
    
7. After watching, go open Github/Gitlab and review your code and try to add comments on what you think should be changed. That PR/MR done previously will help with this.
    
8. Here is how to do the review: First, think about one of the principles you saw explained in the video and read your PR/MR, and add comments there with what to refactor to follow that principle. Then think about the second principle explained and then reread the code and add comments about this second principle. This is called perspective-based review, and it works better when you focus on one thing at a time.
    
9. When finished with your review, go ahead and refactor based on the comments you added there.
    
10. Watch this video [Rules, by Sandi Metz](https://www.youtube.com/watch?v=npOGOmkxuio) and then go ahead and do the same process: Do the review and then refactor your code again.
    
11. Then watch this video [Aloha Ruby Conf 2012 Refactoring from Good to Great by Ben Orenstein](https://www.youtube.com/watch?v=DC-pQPq0acs) and again do the same process: review + refactoring
    

At this point, you will know Ruby Syntax and OOP principles in Ruby.

---

It is time to go deep into idiomatic Ruby:

1. I recommend first reading this https://www.poodr.com/
    
2. Then I recommend you to read this https://www.packtpub.com/product/polished-ruby-programming/9781801072724
    

You don't need to read those books from start to finish. I recommend reading a chapter and doing a code review, and then refactoring.

Then you can read some style guides, but you can search and read more of them:

1. [Shopify Style Guide](https://ruby-style-guide.shopify.dev/)
    
2. [Thoughtbot Style Guide](https://github.com/thoughtbot/guides/tree/main/ruby)
    
3. [AirBnB Style Guide](https://airbnb.io/projects/ruby/)
    
4. [Cookpad Style Guide](https://github.com/cookpad/styleguide/blob/master/ruby.en.md)
    

See which style guide makes sense for you now, and then go ahead and refactor your code to match one of them. Do not try now to mix them, but just take one and refactor your code to follow the guide.

After doing this, it is time that you start using static analysis tools:

1. Install [Rubocop](https://github.com/rubocop/rubocop) and see if any of the style guides that you read has a Rubocop configuration. Use it with Rubocop.
    
2. Install [Ruby Critic](https://github.com/whitesmith/rubycritic) and run it and try to fix reported issues.
    

From now you can start experimenting freely with Ruby and see what you like, what your style is what makes you happy.

---

**Enjoyed this article?**

👐 Subscribe to my Ruby and Ruby on Rails courses over email at [**learn.shortruby.com**](http://learn.shortruby.com/)**\- effortless learning about Ruby anytime, anywhere**

👉 Join my [**Short Ruby Newsnewsletter**](https://newsletter.shortruby.com) for weekly Ruby updates from the community and visit [**rubyandrails.info**](http://rubyandrails.info/)**, a directory with learning content about Ruby.**

🤝 Let's connect on [**Ruby.social**](http://ruby.social/) or [**Linkedin**](https://linkedin.com/in/lucianghinda) or [**Twitter**](https://x.com/lucianghinda) where I post mainly about Ruby and Rails.

🎥 Follow me on [**my YouTube channel**](https://www.youtube.com/@shortruby) for short videos about Ruby

---
Published at: 2022-09-02 | Updated at: 2024-04-13 | Author: Lucian Ghinda
