How to contribute to open source

A guide for Rails beginners

December 01, 2021 · Felipe Vogel ·

Here’s how I recently got started contributing to open-source Ruby on Rails projects. I’m pretty new to Rails, so if I can do it then you can too! (For more tips for beginning Rubyists, see my study plan.)

Find a project

Here are a few beginner-friendly projects, though there are certainly others.

If you want to widen your search, explore the resources at First Timers Only. As you consider projects to contribute to, keep these questions in mind:

Set up the project on your local machine

Once you’ve chosen a project, follow the setup instructions in README.md or CONTRIBUTING.md. You will probably run into problems; use your Google-fu to solve them. For example, here were my setup problems in Ubuntu in WSL2, for two of the projects listed above:

Become familiar with the codebase

Poke around and get a feel for what the app does and how it works. Here are some good starting points in a Rails app:

Find and fix an issue

You can follow roughly these steps:

  1. Make sure you’ve read the project’s README.md and (if it has one) CONTRIBUTING.md.
  2. Find an issue that is well-described and seems simple to fix. Often (but not always) these are tagged as “Good First Issue”.
  3. At this point, some projects prefer that you claim the issue or leave a comment. Be sure to follow the project’s contributing guidelines. Once you have the OK from the project maintainers, or if there are no pre-contributing steps, then it’s time to work on the issue.
  4. Reproduce the issue on your local machine.
  5. Write a test that fails because of the issue. (Not all projects require this, but it’s a good rule of thumb.)
  6. Fix the issue, and make sure your new test passes.
  7. Send back your fix by creating a PR (pull request). To learn how to make a PR, follow the steps in First Contributions. Here is another guide with a few extra steps that are good to keep in mind. Also, if you find that you’ve cloned a project’s repo before forking it, this guide explains how to get back on track by making your local copy point to your fork.
  8. Patiently wait for feedback from the project maintainers, and respond if they ask for more input from you.

Conclusion

If all goes well, your pull request will be accepted and you will have made your first contribution to open source! 🎉 From there you can keep an eye out for new issues in your favorite projects so that you can make even more contributions.

👉 Next: Reviewing Ruby and Rails 👈 Previous: From teacher to developer 🚀 Back to top Tweet