Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

Mix.env/1 being used with string instead of atom when --env="prod" passed from script #383

Closed
schnittchen opened this issue Aug 7, 2016 · 1 comment

Comments

@schnittchen
Copy link

** (FunctionClauseError) no function clause matching in Mix.env/1
    (mix) lib/mix.ex:211: Mix.env("prod")
    lib/exrm/utils/utils.ex:19: ReleaseManager.Utils.with_env/2
    lib/mix/tasks/release.ex:164: Mix.Tasks.Release.generate_sys_config/1
    lib/mix/tasks/release.ex:74: Mix.Tasks.Release.do_run/1
    (mix) lib/mix/project.ex:211: Mix.Project.in_project/4
    (elixir) lib/file.ex:1145: File.cd!/2
    lib/mix/tasks/release.ex:57: anonymous fn/3 in Mix.Tasks.Release.run/1
    (elixir) lib/enum.ex:1623: Enum."-reduce/3-lists^foldl/2-0-"/3

A remote command failed on:

  vagrant@umbrella-test-vagrant

Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:

FAILED with exit status 1:

    [ -f ~/.profile ] && source ~/.profile
    set -e
    cd /tmp/edeliver/phoenixapp/builds
    if [ "mix" = "rebar" ]; then
      echo "using rebar to generate release"
      ./rebar   -f generate
    elif [ "mix" = "relx" ]; then
      echo "using relx to generate release"
      ./relx release
    elif [ "mix" = "mix" ]; then
      echo "using mix to generate release"
      MIX_ENV="prod" LINK_SYS_CONFIG="" LINK_VM_ARGS="" APP="phoenixapp" AUTO_VERSION="" BRANCH="master" SKIP_RELUP_MODIFICATIONS="" RELUP_MODIFICATION_MODULE="" mix  release --verbose --env="prod" --name="phoenixapp"
    fi
@schnittchen
Copy link
Author

The %ReleaseManager.Config{env: } is filled here https://github.com/bitwalker/exrm/blob/master/lib/mix/tasks/release.ex#L449 with a string value. The default https://github.com/bitwalker/exrm/blob/master/lib/exrm/config.ex#L20 is a symbol.

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

No branches or pull requests

2 participants