HashNuke / heroku-buildpack-elixir

Heroku Buildpack for Elixir with nitro boost
MIT License
810 stars 304 forks source link

Can't deploy on Heroku-20, Erlang 21.2.5, Elixir 1.12.2 #208

Closed tashirosota closed 3 years ago

tashirosota commented 3 years ago

Hello,I can't build app on heroku. these errors:

-----> Building on the Heroku-20 stack
-----> Using buildpack: hashnuke/elixir
-----> Elixir app detected
-----> Will export the following config vars:
DATABASE_URL
DB_HOST
DB_NAME
DB_PASSWORD
DB_USER
MIX_ENV
SECRET_KEY_BASE
       * MIX_ENV=prod
-----> Checking Erlang and Elixir versions
       Will use the following versions:
       * Stack heroku-20
       * Erlang 21.2.5
       * Elixir v1.12.2 
-----> Stack changed, will rebuild
-----> Cleaning all cache to force rebuilds
-----> Fetching Erlang 21.2.5 from https://repo.hex.pm/builds/otp/ubuntu-20.04/OTP-21.2.5.tar.gz
-----> Installing Erlang 21.2.5 (changed)
-----> Fetching Elixir v1.12.2 for OTP 21 from https://repo.hex.pm/builds/elixir/v1.12.2-otp-21.zip
-----> Installing Elixir v1.12.2 (changed)
[/tmp/codon/tmp/cache/elixir-v1.12.2-otp-21.zip]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /tmp/codon/tmp/cache/elixir-v1.12.2-otp-21.zip or
        /tmp/codon/tmp/cache/elixir-v1.12.2-otp-21.zip.zip, and cannot find /tmp/codon/tmp/cache/elixir-v1.12.2-otp-21.zip.ZIP, period.
chmod: cannot access '/tmp/build_f7daf5e7/.platform_tools/elixir/bin/*': No such file or directory
-----> Installing Hex
/tmp/codon/tmp/buildpacks/33c47927cb45211dfbbb80b66b1137336c08f55a/lib/elixir_funcs.sh: line 77: mix: command not found
-----> Installing rebar
/tmp/codon/tmp/buildpacks/33c47927cb45211dfbbb80b66b1137336c08f55a/lib/elixir_funcs.sh: line 83: mix: command not found
-----> Executing hook before fetching app dependencies: ./bin/predeps.sh
/tmp/codon/tmp/buildpacks/33c47927cb45211dfbbb80b66b1137336c08f55a/lib/app_funcs.sh: line 45: ./bin/predeps.sh: No such file or directory
 !     Push rejected, failed to compile Elixir app.
 !     Push failed

elixir_buildpack.config

elixir_version=1.12.2
erlang_version=21.2.5
always_rebuild=true
hook_pre_fetch_dependencies="./bin/predeps.sh"

mix.exs

defp deps do
    [
      {:phoenix, "~> 1.5.10"},
      {:phoenix_ecto, "~> 4.1"},
      {:ecto_sql, "~> 3.4"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:phoenix_live_dashboard, "~> 0.4"},
      {:telemetry_metrics, "~> 0.4"},
      {:telemetry_poller, "~> 0.4"},
      {:gettext, "~> 0.11"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.0"},
      {:dotenv, "~> 3.0.0"}
    ]
  end
piacerex commented 3 years ago

Elixir-v1.12.2-otp-21.zip is not found in the log, the cause is that Elixir 1.12 requires Erlang/OTP 22 or higher, and no combination with Erlang/OTP 21. I think it's because of it.

See below for details: https://elixir-lang.org/blog/2021/05/19/elixir-v1-12-0-released/

tashirosota commented 3 years ago

@piacerex Thanks.I resolved it !