diff --git a/bin/web_puma b/bin/web_puma
index 178fe84800d4105d8ba11426f2d7bff6cc91fb53..29d72cd4a415b38caf55532e203ce87ea46347ec 100755
--- a/bin/web_puma
+++ b/bin/web_puma
@@ -10,7 +10,7 @@ puma_config="$app_root/config/puma.rb"
 
 spawn_puma()
 {
-  exec bundle exec puma --config "${puma_config}" "$@"
+  exec bundle exec puma --config "${puma_config}" --environment "$RAILS_ENV" "$@"
 }
 
 get_puma_pid()
diff --git a/changelogs/unreleased/fix-bin-web-puma-script-to-consider-rails-env.yml b/changelogs/unreleased/fix-bin-web-puma-script-to-consider-rails-env.yml
new file mode 100644
index 0000000000000000000000000000000000000000..a0564369b02c2acfd3ead7d125ad0f77d430a7a5
--- /dev/null
+++ b/changelogs/unreleased/fix-bin-web-puma-script-to-consider-rails-env.yml
@@ -0,0 +1,5 @@
+---
+title: Make `bin/web_puma` consider RAILS_ENV
+merge_request: 31378
+author:
+type: fixed