Skip to content

Postdeploy error creating the Heroku app #6

Open
@mllocs

Description

@mllocs

WHAT

When creating the app with the "Deploy to Heroku" button, the default configuration of the app.json file leads to a Postdeploy error:

ActiveRecord::ProtectedEnvironmentError: You are attempting to run a destructive action against your 'production' database.
If you are sure you want to continue, run the same command with the environment variable:
DISABLE_DATABASE_ENVIRONMENT_CHECK=1

The error comes from this postdeploy script (defined in the app.json file):

"scripts": {
  "postdeploy":"SEED=true rake db:schema:load db:migrate db:seed"
},

SOLUTIONS

We could remove that postdeploy script and update the README file suggesting to run that script manually. This way the user understands what's happening and can decide to use the DISABLE_DATABASE_ENVIRONMENT_CHECK=1 env var.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions