Skip to content

Commit c55d3f7

Browse files
justin808claude
andcommitted
Fix Rails 8.1+ deployment by adding SECRET_KEY_BASE to release script
Rails 8.1.1 (introduced in commit baac683) requires SECRET_KEY_BASE to be set during initialization, even for tasks like db:prepare that don't actually use the secret key. This change updates the release script to provide a placeholder SECRET_KEY_BASE value if one isn't already set in the environment, similar to the fix in commit 6039dd7 for the Docker build phase. The actual SECRET_KEY_BASE for runtime will still come from the deployment environment variables. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f4a07bd commit c55d3f7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.controlplane/release_script.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ log 'Running release_script.sh per controlplane.yml'
1414

1515
if [ -x ./bin/rails ]; then
1616
log 'Run DB migrations'
17-
./bin/rails db:prepare || error_exit "Failed to run DB migrations"
17+
# SECRET_KEY_BASE is required for Rails 8.1+ initialization but not used for migrations
18+
# The actual secret key will be provided at runtime by the environment
19+
SECRET_KEY_BASE="${SECRET_KEY_BASE:-precompile_placeholder}" ./bin/rails db:prepare || error_exit "Failed to run DB migrations"
1820
else
1921
error_exit "./bin/rails does not exist or is not executable"
2022
fi

0 commit comments

Comments
 (0)