Skip to content

Env is not correct when preloading #305

Open
@jpalermo

Description

@jpalermo

When a new Spring::Application is created it calls preload first. However, it does this with the ENV settings from when the Spring server was first started.

This can cause preloading to fail if you are trying to set your database connection string using a DATABASE_URL.

If you first started spring in a RAILS_ENV that did not require DATABASE_URL to be set, because it is in the database.yml file. Then you try to start a console in another RAILS_ENV that requires a DATABASE_URL, the preload fails because it does not have DATABASE_URL set when doing the preload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions