Preparing content
Just a brief moment...
Just a brief moment...
Learn how to set up Steep for static type checking in your Ruby on Rails project with a practical Steepfile configuration. Discover tips, tools, and a beginner-friendly approach to adding RBS to your Rails codebase without sacrificing flexibility.

Static typing might not be the first thing that comes to mind when working with Ruby - but it’s becoming a valuable tool for many developers who want more clarity and confidence in their codebases.
That said, it’s important to remember: you don’t have to use it everywhere. You’re not giving up Ruby’s flexibility or developer happiness. You can still write expressive code and enhance it with RBS or Sorbet where it makes sense.
I covered this approach in more detail here: Static typing is not either-or
If you’re working on a plain Ruby project, adding RBS (Ruby’s official type signature language) is fairly straightforward. You write .rbs files to describe your classes and methods, and tools like Steep will check your code for type mismatches.
Rails adds some complexity - mostly because of its dynamic and convention-heavy structure. The first time you try to add static typing in a Rails app, it might feel overwhelming.
But here’s the good news: there’s a clean and simple way to set it up using a minimal Steepfile configuration.
Here’s a basic Steepfile you can use as a default config:
# Steepfile
target :app do
signature "sig"
check "app"
check "lib"
ignore "db/schema.rb"
ignore "db/migrate"
ignore "bin"
ignore "node_modules"
ignore "vendor"
end
target :test do
signature "sig-test"
check "test" # if you use MiniTest
# 2 lines below if you use RSpec
check "spec"
ignore "spec/dummy"
end
:app target covers the main parts of your application: app/ and lib/.db/migrate and node_modules.app/ or lib/ depending on your needs.:test target includes both MiniTest (test/) and RSpec (spec/). Keep whichever one you actually use in your project.sig folder to store signatures for your Rails app, and sig-test (if needed) to store type signature used for your tests.If you'd rather focus on writing code and avoid boilerplate, check out rbs_rails. It can generate RBS signatures for your existing Rails code - like models, concerns, and more.
If you're interested in understanding RBS and static typing in Ruby in more depth, I created a video course that walks you through everything step-by-step: 🎓 Ruby on Types – Write Robust Software with RBS
Or stay updated via my newsletter: 📬 Static Ruby Newsletter
Thanks for reading - and happy typing!