在 Debian 11 中使用 asdf 安装了 Erlang/Elixir。 出现“找不到混合命令”错误。
检查兼容性:https://hexdocs.pm/elixir/master/compatibility-and-deprecations.html#erlang-otp-compatibility。 Erlang 24.2.1 和 elixir 1.13.2-otp-24 似乎是兼容的。
添加路径:/etc/profile.d/elixir.sh 像这样:
export PATH=$PATH:/usr/local/lib/elixir/1.13.2-otp-24/bin
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"
有什么想法吗?
我用来安装的脚本:
# Install asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc
source ~/.bashrc
# Install dependencies
sudo apt update
sudo apt install -y build-essential libncurses5-dev libssl-dev
# Install Erlang
sudo apt-get update && sudo apt-get -y install build-essential autoconf m4 libncurses5-dev libwxgtk3.0-gtk3-dev libgl1-mesa-dev libglu1-mesa-dev libssh-dev unixodbc-dev xsltproc fop libxml2-utils openjdk-17-jdk openssl libssl-dev
asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git
asdf install erlang 24.2.1
# Install Elixir
asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir.git
asdf install elixir 1.13.2-otp-24
# Install Node.js
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git
asdf install nodejs 16.13.2
# resource
source ~/.bashrc
我认为你应该从你的路径中删除这个:
/usr/local/lib/elixir/1.13.2-otp-24/bin
,然后运行asdf global
:
asdf global erlang 24.2.1
asdf global elixir 1.13.2-otp-24
asdf global nodejs 16.13.2