jrogov / wootheex

Super fast User-Agent parser for Elixir
Apache License 2.0
4 stars 2 forks source link

Getting error when installing #1

Closed scottmessinger closed 3 years ago

scottmessinger commented 3 years ago

Hi! This looks great! I'm getting an error when I try to start phoenix:

==> wootheex
Compiling NIF crate :wootheex_nif (native/wootheex_nif)...
could not compile dependency :wootheex, "mix compile" failed. You can recompile this dependency with "mix deps.compile 
wootheex", update it with "mix deps.update wootheex" or clean it with "mix deps.clean wootheex"
** (ErlangError) Erlang error: :enoent
    (elixir) lib/system.ex:791: System.cmd("cargo", ["rustc", "--release"], [cd: "/PATH_TO_PROJECT/deps/wootheex/native/wootheex_nif", stderr_to_stdout: true, env: [{"CARGO_TARGET_DIR", "/PATH_TO_PROJECT/_build/test/rustler_crates/wootheex_nif"}], into: %IO.Stream{device: :standard_io, line_or_bytes: :line, raw: false}])
    lib/mix/tasks/compile.rustler.ex:59: Mix.Tasks.Compile.Rustler.compile_crate/1
    (elixir) lib/enum.ex:1336: Enum."-map/2-lists^map/1-0-"/2
    lib/mix/tasks/compile.rustler.ex:15: Mix.Tasks.Compile.Rustler.run/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3
    (mix) lib/mix/tasks/compile.all.ex:73: Mix.Tasks.Compile.All.run_compiler/2
    (mix) lib/mix/tasks/compile.all.ex:53: Mix.Tasks.Compile.All.do_compile/4
    (mix) lib/mix/tasks/compile.all.ex:24: anonymous fn/1 in Mix.Tasks.Compile.All.run/1

I've done the compile, update, and clean steps suggested and no change. Any idea what's going on? Is this something on my end?

jrogov commented 3 years ago

You need to install rust compiler (rustc) along with it's cargo package manager. Gotta be something like rust in many distros.

Guess should clear this up in the readme.

UPD: Updated the README.

scottmessinger commented 3 years ago

Good to know! For us, it would be nice if there were precompiled binaries so we can deploy it without having to have rustc and cargo.