github << rails / stimulus / hotwire

Rails: Lazy-loading Dependencies October 09, 2025

There are ruby gems that doesn’t need to be implicitly “required” in the application. A perfect use-case would be a gem that you’ll only use inside a rake task. You probably don’t need that included in the whole application.

This is what require does.

# Gemfile
gem "groupdate", require: false

In order to use this gem, you’ll have to explicitly require it otherwise an error will occur. It’s a neat feature and could be something to look at when doing performance optimizations.