簡體   English   中英

混合編譯過程的庫路徑

[英]LIbrary paths for mix compile process

從Elixir和Erlang的brew轉換為asdf版本控制工具后,我仍然無法編譯我的舊項目:在編譯過程中,它嘗試引用不存在的Brew的Cellar lib文件:

MacBook-Pro% mix test
==> gettext
Compiling 1 file (.erl)
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:59: illegal pattern
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:60: variable 'Error' is unbound
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:60: variable 'Stacktrace' is unbound
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:63: variable 'Stacktrace' unsafe in 'try' (line 60)
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:64: variable 'Error' unsafe in 'try' (line 60)
/usr/local/Cellar/erlang/21.3.2/lib/erlang/lib/parsetools-2.1.8/include/yeccpre.hrl:64: variable 'Stacktrace' unsafe in 'try' (line 60)
could not compile dependency :gettext, "mix compile" failed. You can recompile this dependency with "mix deps.compile gettext", update it with "mix deps.update gettext" or clean it with "mix deps.clean gettext"

即使沒有任何/usr/local/Cellar/erlang文件夾

混合在哪里將使用外部erlang庫的路徑,以及如何更改它以使用asdf的包?

Erlang以及Elixir都使用$PATH環境變量中的二進制文件和庫文件,如下所述: https : //elixir-lang.org/install.html#installing-erlang

通常在$PATH的末尾加載asdf,這意味着如果仍然通過brew安裝了Erlang和Elixir,則將首先加載它。 也就是說,請仔細檢查是否通過brew安裝了其他任何Erlang版本。 您可以使用brew uninstall erlang --force命令卸載所有版本。

還可以使用以下命令在項目的根目錄中設置本地Erlang和Elixir版本:

asdf local erlang 21.3.2
asdf local elixir 1.8.1-otp-21

根據您的環境更改版本。

最后檢查命令asdf current是否正在加載正確的版本。 它應該顯示如下內容:

elixir         1.8.1-otp-21 (set by /path/to/project/.tool-versions)
erlang         21.3.2   (set by /path/to/project/.tool-versions)

作為最后的手段,請查看https://asdf-vm.com/#/core-manage-asdf-vm?id=having-issues

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM