Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable loading .env file when running foreman for development #155

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

Flixt
Copy link
Contributor

@Flixt Flixt commented Jun 2, 2024

TL;DR;

This PR fixes the problem that when a RAILS_MASTER_KEY is defined with the key for production in .env (which is the case when using Kamal for deployment), the script in bin/dev will start foreman which will then pick up the variables from .env leading to a ActiveSupport::MessageEncryptor::InvalidMessage error when running bin/dev

Kamal is added by default for new Rails apps >= v8 (see rails/rails#51798). Although, it seems that is not fully initialized and the .env file generated by kamal init is removed when a new Rails app is generated.

--

There are several other problems with the .env approach of Kamal, so I'm not entirely sure if this PR is the "correct" fix, but is seems reasonable as bin/dev is only run locally to start bundling + rails.

See other:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants