Skip to content

Commit 3ba6bc1

Browse files
feliperaulFelipe
andauthored
Update the upgrade guides for Rails 7.1 regarding the breaking change (in development/test environments) of the location of secret_key_base (rails#52083)
Co-authored-by: Felipe <[email protected]>
1 parent 564b434 commit 3ba6bc1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

guides/source/upgrading_ruby_on_rails.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ Upgrading from Rails 7.0 to Rails 7.1
102102

103103
For more information on changes made to Rails 7.1 please see the [release notes](7_1_release_notes.html).
104104

105+
### Development and test environments secret_key_base file changed
106+
107+
In development and test environments, the file from which Rails reads the `secret_key_base` has been renamed from `tmp/development_secret.txt` to `tmp/local_secret.txt`.
108+
109+
You can simply rename the previous file to `local_secret.txt` to continue using the same secret, or copy the key from the previous file to the new one.
110+
111+
Failure to do so will cause Rails to generate a new secret key in the new file `tmp/local_secret.txt` when the app loads.
112+
113+
This will invalidate all existing sessions/cookies in development and test environments, and also cause other signatures derived from `secret_key_base` to break, such as Active Storage/Action Text attachments.
114+
115+
Production and other environments are not affected.
116+
105117
### Autoloaded paths are no longer in $LOAD_PATH
106118

107119
Starting from Rails 7.1, the directories managed by the autoloaders are no

0 commit comments

Comments
 (0)