0

Good Afternoon, I downloaded and compiled erlang 1.22 elixir 1.11 and phoenix 1.4. i created a demo app (studying the framework), and managed to install some libraries postgrex,plug_cowboy etc. I wanted to give a try to zstd and placed this in my mix.exs file

  defp deps do
[
  {:phoenix, "~> 1.3.4"},
  {:phoenix_pubsub, "~> 1.0"},
  {:phoenix_ecto, "~> 3.2"},
  {:postgrex, ">= 0.0.0"},
  {:gettext, "~> 0.11"},
  {:cowboy, "~> 1.0"},
  {:plug_cowboy, "~> 1.0"},
  {:ex_zstd, "~> 0.1.0"},
  {:guardian, "~> 2.0"}

]

I typed mix.deps.get and all is download nicely, but once i try to type mix phx.server it gives me this error

 warning: found quoted keyword "test" but the quotes are not required. Note that keywords are always atoms, even when quoted. Similar to atoms, keywords made exclusively of Unicode letters, numbers, underscore, and @ do not require quotes
  mix.exs:59
/usr/bin/make -C ../libzstd lib-release
make[1]: *** ../libzstd: No such file or directory.  Stop.
Makefile:37: recipe for target 'priv/nif_ex_zstd.so' failed
make: *** [priv/nif_ex_zstd.so] Error 2
==> ex_zstd
Compiling 1 file (.ex)
could not compile dependency :ex_zstd, "mix compile" failed. You can recompile this dependency with "mix deps.compile ex_zstd", update it with "mix deps.update ex_zstd" or clean it with "mix deps.clean ex_zstd"

17:29:08.110 [warn]  The on_load function for module Elixir.ExZstd returned:
{{:badmatch, {:error, {:load_failed, 'Failed to load NIF library: \'/home/eddyraz/proyectos/zunder/_build/dev/lib/ex_zstd/priv/nif_ex_zstd.so: cannot open shared object file: No such file or directory\''}}}, [{ExZstd, :__init__, 0, [file: 'lib/ex_zstd.ex', line: 12]}, {:code_server, :"-handle_on_load/5-fun-0-", 1, [file: 'code_server.erl', line: 1340]}]}


17:29:08.109 [error] Process #PID<0.197.0> raised an exception
** (MatchError) no match of right hand side value: {:error, {:load_failed, 'Failed to load NIF library: \'/home/eddyraz/proyectos/zunder/_build/dev/lib/ex_zstd/priv/nif_ex_zstd.so: cannot open shared object file: No such file or directory\''}}
    lib/ex_zstd.ex:12: ExZstd.__init__/0
    (kernel 6.5.2) code_server.erl:1340: anonymous fn/1 in :code_server.handle_on_load/5
** (KeyError) key :ex_doc not found in: %{libzstd: :compile}
    (stdlib 3.12) :maps.get(:ex_doc, %{libzstd: :compile})
    (mix 1.11.0-dev) lib/mix/tasks/compile.app.ex:357: anonymous fn/4 in Mix.Tasks.Compile.App.apps_from_prod_non_optional_deps/2
    (elixir 1.11.0-dev) lib/enum.ex:2115: Enum."-reduce/3-lists^foldl/2-0-"/3
    (mix 1.11.0-dev) lib/mix/tasks/compile.app.ex:355: Mix.Tasks.Compile.App.apps_from_prod_non_optional_deps/2
    (mix 1.11.0-dev) lib/mix/tasks/compile.app.ex:345: Mix.Tasks.Compile.App.handle_extra_applications/2
    (mix 1.11.0-dev) lib/mix/tasks/compile.app.ex:159: Mix.Tasks.Compile.App.run/1
    (mix 1.11.0-dev) lib/mix/task.ex:397: Mix.Task.run_task/3
    (mix 1.11.0-dev) lib/mix/tasks/compile.all.ex:76: Mix.Tasks.Compile.All.run_compiler/2

(I already installed libzstd-dev and libzstd1-dev and nothong worked). Any light on this would be very apreciated, thanks very much in advance.

eddyraz
  • 41
  • 1
  • 1
  • 7
  • Could that help : https://hex.pm/packages/ex_zstd ? – Cyan May 11 '20 at 23:58
  • 1
    There is no `erlang 1.22`, neither `elixir 1.11` (you seem to use `dev` version. Why?) According to your `mix.exs`, you use `phoenix 1.3.4`, not `phoenix 1.4`. I would suggest you start with understanding what stack are you actually working with. – Aleksei Matiushkin May 12 '20 at 03:32
  • @Cyan the problem is that `NIF` from `ex_zstd` cannot be compiled. How your reference is supposed to help? – Aleksei Matiushkin May 12 '20 at 03:36
  • 1
    Note that `warning: found quoted keyword "test"` is only a warning (you can ignore it, or remove the quotes around the `"test"` in the `mix.exs`). As Aleksei pointed out, you seem to be using an odd combination of bleeding edge dev versions of Elixir and a very old version of Phoenix. Can you try creating a new project using the latest version of Phoenix from hex.pm? (1.5.1) – Everett May 12 '20 at 15:03
  • excuse me I mistyped Erlang it is actually version 22, Iĺll try installing the latest stable versions of both elixir and phoenix, and try again, thanks. – eddyraz May 14 '20 at 15:37
  • Well finally got this to work well.I missed there was a binary of the latest stable version compressed file of elixir and used it and now everything is working fine, thanks a lot – eddyraz Jun 05 '20 at 11:48

0 Answers0