From 17b5a2414e0e1390554762211cc6e08556f216d7 Mon Sep 17 00:00:00 2001 From: Kristin Martin Date: Wed, 1 Jul 2026 20:59:35 +0000 Subject: [PATCH] Note dockerfile-rails gem requirement in Rails Dockerfiles guide Running 'bin/rails generate dockerfile' on an older Rails app that predates the dockerfile-rails gem fails with 'Could not find generator dockerfile'. Add a callout pointing users to add the gem first. Supersedes #1184. --- rails/getting-started/dockerfiles.html.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rails/getting-started/dockerfiles.html.md b/rails/getting-started/dockerfiles.html.md index c8584271ef..e3cd005bb3 100644 --- a/rails/getting-started/dockerfiles.html.md +++ b/rails/getting-started/dockerfiles.html.md @@ -27,6 +27,10 @@ to do is rerun the generator: bin/rails generate dockerfile ``` +
+If you get a `Could not find generator 'dockerfile'.` error, your app predates the `dockerfile-rails` gem. Add [dockerfile-rails](https://github.com/rubys/dockerfile-rails) to your Gemfile and run `bundle install` first. +
+ The generator will remember the options you selected before (these are stored in `config/dockerfile.yml`). If you need to change a boolean option, add or remove a `no-` prefix before the option name.