You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: posts/2025-08-01-watch-out-for-this-one-deprecation-warning-when-upgrading-from-rails-7-dot-1-to-7-dot-2-on-heroku.md
+5-8Lines changed: 5 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ publish: false
8
8
# Watch out for this one deprecation warning when upgrading from Rails 7.1 to 7.2 on Heroku
9
9
10
10
We recently upgraded Rails from 7.0 to 7.1 for one of our clients. It went smoothly.
11
-
12
11
When Rails 7.1 went live, we were pleased to see a new set of deprecation warnings. To avoid being overwhelmed by them, we decided to address the issue right away.
12
+
However, we ran into a nasty issue...
13
13
14
-
However, we ran into a nasty issue.
14
+
## The one with nasty issue
15
15
16
16
The application didn't crash.
17
17
@@ -22,7 +22,8 @@ Either of those would have been better. The worst that can happen is silence.
22
22
The deprecation warning was:
23
23
24
24
```ruby
25
-
[DEPRECATION] DEPRECATIONWARNING:`Rails.application.secrets` is deprecated in favor of `Rails.application.credentials`and will be removed inRails7.2.
25
+
[DEPRECATION] DEPRECATIONWARNING:`Rails.application.secrets` is deprecated
26
+
in favor of `Rails.application.credentials`and will be removed inRails7.2.
26
27
```
27
28
28
29
We removed values from `ENV["SECRET_KEY_BASE"]` to credentials and checked that the value was correct by calling
@@ -49,19 +50,15 @@ Ok so to sum it up, until now:
49
50
- We removed ENV
50
51
- So it should take the value from credentials
51
52
52
-
Right?
53
-
54
-
But instead...
53
+
Right? But instead...
55
54
56
55
Instead it failed silently. So where’s the poop?
57
56
58
-
59
57
The poop is in Heroku trying to be smarter than developers. Unfortunately. It turned out that removing `SECRET_KEY_BASE` env leads to.. regenerating it with new **random** value.
60
58
61
59
So our external devices depending on it couldn’t work because of new, randomly generated key.
62
60
63
61
## Summary
64
-
65
62
To sum it up:
66
63
- If you’re getting rid of the `Rails.application.secrets` is deprecated in favor of `Rails.application.credentials` and will be removed in Rails 7.2
0 commit comments