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

Add clean error message when RAILS_ENV is unset #15381

Merged
merged 1 commit into from
Dec 20, 2020

Conversation

ClearlyClaire
Copy link
Contributor

By default, an unset RAILS_ENV is understood as RAILS_ENV=development.

However, this is not what most people expect, and due to development-only dependencies, users are often left with confusing error messages.

This commit changes it so that an explicit RAILS_ENV is required, and failing that, an error message is displayed before loading the app.

By default, an unset RAILS_ENV is understood as RAILS_ENV=development.

However, this is not what most people expect, and due to development-only
dependencies, users are often left with confusing error messages.

This commit changes it so that an explicit RAILS_ENV is required, and
failing that, an error message is displayed before loading the app.
@Gargron Gargron merged commit 9734c9b into mastodon:master Dec 20, 2020
umonaca added a commit to umonaca/mastodon that referenced this pull request Dec 21, 2020
@mjankowski
Copy link
Contributor

I realize this is ~2+ years ago ... has this been a largely positive change?

For my personal workflow -- the defaulting to development seems fine; the test setup helpers explicitly set things to test; and I'd expect anyone running a production server to be comfortable explicitly setting env vars appropriately.

I'm curious what the background issues here were that users had confusing error messages ... was this confusion amongst people doing local development, or actual users of running production servers which had been misconfigured?

@ClearlyClaire
Copy link
Contributor Author

I realize this is ~2+ years ago ... has this been a largely positive change?

Hard to say, but I'd say it has been, since we haven't seen anyone confused by that addition, and stopped receiving people posting tracebacks that were due to running commands against a dev environment instead of a production one.

I'm curious what the background issues here were that users had confusing error messages ... was this confusion amongst people doing local development, or actual users of running production servers which had been misconfigured?

The confusion was from admins trying to run commands in production environments but without setting RAILS_ENV. This would be mostly errors about some (dev-only) dependencies not being found, which can be highly confusing.

@mjankowski
Copy link
Contributor

Cool, thanks for explanation and glad to hear it's reduced confusion on admin side.

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.

3 participants