Fork elixir-china 要在 local 上執行時出現 Error

作者 lithiumpie 所属板块 问答
Hello, 新手一個. [https://github.com/lithiumpie/elixir-china](https://github.com/lithiumpie/elixir-china) 今天想在 local 試一下, 執行到第 2 步時出現 Error ``` $ mix ecto.create Repo ``` Error Msg ```zsh warning: variable "description" does not exist and is being expanded to "description()", please use parentheses to remove the ambiguity or change the variable name /Users/SHL/Desktop/elixir-china/deps/uuid/mix.exs:8 warning: variable "package" does not exist and is being expanded to "package()", please use parentheses to remove the ambiguity or change the variable name /Users/SHL/Desktop/elixir-china/deps/uuid/mix.exs:9 warning: variable "deps" does not exist and is being expanded to "deps()", please use parentheses to remove the ambiguity or change the variable name /Users/SHL/Desktop/elixir-china/deps/uuid/mix.exs:10 ==> quickrand (compile) ERROR: OTP release 20 does not match required regex R16|17|18|19 ERROR: compile failed while processing /Users/SHL/Desktop/elixir-china/deps/quickrand: rebar_abort ** (Mix) Could not compile dependency :quickrand, "/Users/SHL/.mix/rebar compile skip_deps=true deps_dir="/Users/SHL/Desktop/elixir-china/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile quickrand", update it with "mix deps.update quickrand" or clean it with "mix deps.clean quickrand" ``` 照著提示執行過 `mix deps.compile quickrand` , `mix deps.update quickrand` , `mix deps.clean quickrand` 問題還是存在, 不知道要怎麼改比較好, 似乎是 `rebar` ? 不過試過 ```elixir $ mix local.rebar ``` 錯誤還是出現 * Ref Phoenix basic setup error [https://elixirforum.com/t/phoenix-basic-setup-error/3189](https://elixirforum.com/t/phoenix-basic-setup-error/3189)
1 回复
  • bingoabs25 发表
    我也是刚安装, 遇到同样的问题: 1. 你应该使用的Erlang/OTP 20; 2. Elixir-China 使用的 一个依赖库 bcrypt, 包含了不兼容 OTP 20的代码, 具体是: 其使用的`crypto:rand_bytes/1` 在20.0被移除, 应该改为`crypto:strong_rand_bytes/1`, 位于文件bcrypt_port.erl 与bcrypt_nif.erl 中, 共计3处 3.另一个依赖库 quickrand 不知道基于什么原因,虽然支持了20.0版本, 但是在版本判断中只支持到19, 可以将该库的rebar.config 由{require_otp_vsn, "R16|17|18|19"}. 改为{require_otp_vsn, "R16|17|18|19|20"}.