Skip to content

Commit 5742b4c

Browse files
committed
visuals
1 parent 6f555b7 commit 5742b4c

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ publish: false
88
# Watch out for this one deprecation warning when upgrading from Rails 7.1 to 7.2 on Heroku
99

1010
We recently upgraded Rails from 7.0 to 7.1 for one of our clients. It went smoothly.
11-
1211
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...
1313

14-
However, we ran into a nasty issue.
14+
## The one with nasty issue
1515

1616
The application didn't crash.
1717

@@ -22,7 +22,8 @@ Either of those would have been better. The worst that can happen is silence.
2222
The deprecation warning was:
2323

2424
```ruby
25-
[DEPRECATION] DEPRECATION WARNING: `Rails.application.secrets` is deprecated in favor of `Rails.application.credentials` and will be removed in Rails 7.2.
25+
[DEPRECATION] DEPRECATION WARNING: `Rails.application.secrets` is deprecated
26+
in favor of `Rails.application.credentials` and will be removed in Rails 7.2.
2627
```
2728

2829
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:
4950
- We removed ENV
5051
- So it should take the value from credentials
5152

52-
Right?
53-
54-
But instead...
53+
Right? But instead...
5554

5655
Instead it failed silently. So where’s the poop?
5756

58-
5957
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.
6058

6159
So our external devices depending on it couldn’t work because of new, randomly generated key.
6260

6361
## Summary
64-
6562
To sum it up:
6663
- 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
6764
- And you’re on Heroku

0 commit comments

Comments
 (0)